Re: clock()
From: Alex (sdfjkhsdkh_at_ksfjdkjwdfsklj.nowhere)
Date: 07/07/04
- Next message: Doug Harrison [MVP]: "Re: Bit-related question"
- Previous message: Arnaud Debaene: "Re: Class and static member"
- In reply to: Victor Bazarov: "clock()"
- Next in thread: Victor Bazarov: "Re: clock()"
- Reply: Victor Bazarov: "Re: clock()"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 07 Jul 2004 14:44:19 -0400
Victor Bazarov <v.Abazarov@comAcast.net> wrote in news:
#gH7pzEZEHA.992@TK2MSFTNGP10.phx.gbl:
> Is it a known issue that in VC++ RTL the function 'clock()'
> reports the wall clock instead of CPU time used?
I've recently hit few problems with several time functions
implementations. In MSVC5 'clock' returns the difference between
'_ftime' from the start of the process. Considering that '_ftime'
returns wall clock, 'clock' won't provide you with the CPU (or
process) time for the calling process. And if the system time on the
host has been adjusted during the life of your application you may
get some strange results from 'clock'. Besides, time(0) also had a
problems MSVC5, but they have apparently been fixed in MSVC7 (look
for the recent thread).
<snip>
>
> I know of GetProcessTimes() function, but couldn't 'clock()'
> be implemented to use it?
GetProcessTimes is not available in 95 family, so 'clock' would have
to be implemented differently depending on windows OS family (not
that I'm against it :->).
Alex.
- Next message: Doug Harrison [MVP]: "Re: Bit-related question"
- Previous message: Arnaud Debaene: "Re: Class and static member"
- In reply to: Victor Bazarov: "clock()"
- Next in thread: Victor Bazarov: "Re: clock()"
- Reply: Victor Bazarov: "Re: clock()"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|