Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: clock() in background

Author: Peter Fendrich

Date: 16:21:31 01/25/00

Go up one level in this thread


On January 25, 2000 at 19:02:24, Dann Corbit wrote:

>On January 25, 2000 at 18:56:37, Peter Fendrich wrote:
>
>>I tried to use the clock() function (in NT4) and it didn't behave as I expected
>>it to.
>>It is said to "Return elapsed CPU time for current process".
>>I hoped to be able to run performance tests with my chess program in the
>>background while doing other things in the foreground and yet get the same
>>results.
>>The clock() is definitely affected by other processes so I get very varied
>>results depending on what I'm doing in the foreground.
>>
>>How come?
>
>The cost of the context switches.  The context switches in and out of your
>threads will still be part of the time used by your process.

ok, maybe I have a simplified view of processes in NT but when the clock()
function is said to "Calculate the processor time used by the calling process"
my interpretation is that this is the effective time used by the process itself.
Other processes time shouldn't be counted in.

>
>If you do a start/high <myprogram> it will get a lion's share of the slices and
>timing will be more accurate.  However, doing other tasks will suffer
>enormously.  Don't do a start/realtime unless you don't want to use your machine
>again until it is finished.  Besides which, the timing studies over start/high
>are very small.
>
>A better alternative is to use a profiler like vtune.
It's not profiling I'm looking for here, just counting nodes and taking the time
etc.
//Peter



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.