delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/11/26/09:45:35

Date: Mon, 26 Nov 2001 16:43:12 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Alex Vinokur <alexvn AT bigfoot DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Getting system time used
In-Reply-To: <3C0245B8.F5B2EBD4@bigfoot.com>
Message-ID: <Pine.SUN.3.91.1011126163809.14031B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 26 Nov 2001, Alex Vinokur wrote:

> The only field of  struct rusage is computed is DJGPP :
>    struct timeval ru_utime;  /* total time used by process */
> 
> How can we get total _system_ time used?

DOS/Windows don't let DJGPP programs get at this kind of info.  In order 
to implement this functionality, one should modify __dpmi_int, which is a 
gateway to all system calls, so that it peeks at the system clock before 
and after the call, and accumulates the results.

Would you like to volunteer to do that?

> For instance, in UNIX
> http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?getrusage+3
> struct rusage contains the fields
>    struct timeval ru_utime;/* user time used */
>    struct timeval ru_stime;/* system time used */

On Unix systems, getrusage() talks to the OS kernel and gets the info 
directly from the OS.  So life is muche easier on Unix.  No such luxury 
on DOS/Windows...

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019