delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/16/07:06:55

From: nik AT tiuk DOT ti DOT com (Nick Ing-Simmons)
Subject: Re: Function times still broken?
16 Dec 1996 07:06:55 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199612161225.MAA09513.cygnus.gnu-win32@phoenix>
References: <199612160649 DOT XAA10885 AT joplin DOT colorado DOT edu>
Original-To: fabio AT joplin DOT colorado DOT edu
Original-Cc: gnu-win32 AT cygnus DOT com
In-Reply-To: <199612160649.XAA10885@joplin.colorado.edu>
from Fabio Somenzi on Sun, 15 Dec 1996 23: 49:39 -0700
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Fabio Somenzi <fabio AT joplin DOT colorado DOT edu> writes:
>When I run the following program under b17.1 on my Win95 laptop
>----------------------------------------------------------------
>#include <stdio.h>
>#include <sys/types.h>
>#include <sys/times.h>
>
>int
>main()
>{
>    clock_t time;
>    struct tms buffer;
>
>    time = times(&buffer);
>
>    printf("buffer = %lu\n", (unsigned long) buffer.tms_utime);
>    printf("       = %lu\n", (unsigned long) buffer.tms_stime);
>    printf("       = %lu\n", (unsigned long) buffer.tms_cutime);
>    printf("       = %lu\n", (unsigned long) buffer.tms_cstime);
>    printf("time   = %lu\n", (unsigned long) time);
>
>    exit(0);
>
>}
>----------------------------------------------------------------
>I get results like this one:
>
>buffer = 560564963
>       = 551978954
>       = 0
>       = 0
>time   = 47919604
>
>The first two numbers should give the user and system CPU time of the
>process, but they rather seem random. Successive runs of the program
>produce increasinv values of "time" (as expected) but identical values
>of "buffer" (suspect).

As each "run" is a new "process" the buffer values should always 
be the same (give or take resolution).
That said values look weird.

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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