Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: The POSIX getrusage function approximated for Win32

Author: Heiner Marxen

Date: 08:22:08 09/20/04

Go up one level in this thread


On September 16, 2004 at 15:12:24, Dann Corbit wrote:

>ftp://cap.connx.com/pub/chess-engines/new-approach/getrusage.c

        /* The units returned by GetProcessTimes are 100 nanoseconds */
        usage->ru_utime.tv_sec = (long) (u_time / 10000000);
        usage->ru_stime.tv_sec = (long) (k_time / 10000000);
ok.
        usage->ru_utime.tv_usec = (long) (u_time % 10000000);
        usage->ru_stime.tv_usec = (long) (k_time % 10000000);
Don't we need a (... / 10), here?

Cheers,
Heiner


>Useful for portable calculation of a program's time usage.
>
>Only works for RUSAGE_SELF
>
>If someone knows how to make it work correctly for RUSAGE_CHILDREN, I would
>appreciate the appropriate corrections.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.