Subject: timming cpu time in windows

From: "Tzahi Fadida" <[email-masked]>
Date: Sat, 14 Dec 2002 20:58:21 +0200

hi all,
I have a problem with a win32 consol programm in visual c++ i am writing(in windows
2000). i am implementing the A* search algorithm and i need to determine how much
time it ran. the problem is when i use
clock_t clock() from the time.h standard library, i get an approximate time, which in
the simple problems i give it, returns a zero time passed.
my question is, where can i find a time function with greater accuracy. so it will
not return a zero, and at least retun some number. also, it would be better if its
not platform specific, or at least for a pentium and win2000.
10x.

* - * - *
Tzahi Fadida
[email-masked]
Technion Email: [email-masked]
My Cool Site: HTTP://WWW.My2Nis.Com
* - * - * - * - * - * - * - * - * - *
WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html

---

From: Omer Zak <[email-masked]>
Date: Sun, 15 Dec 2002 17:16:38 +0200 (EET)

> the simple problems i give it, returns a zero time passed.

How about running the relevant piece of code say 1000 times in a loop and
timing the entire loop execution time and dividing it by 1000?
                                             --- Omer
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

---

From: "Tzahi Fadida" <[email-masked]>
Date: Sun, 15 Dec 2002 17:36:02 +0200

to answer myself, since it take 24hrs for an email to get to the list members for
some reason.
I found micorosfts Hi-Res timers and used the timeGettime function together with the
devcaps on
a 1ms resolution interval.
the library is the multimedia timer library winmm.lib and the header file mmsystem.h
check out msdn for the rest.

still, the realy simple cases of my A star and Iterative Deepening A star algoritms
returns zero run-time
because they are in micro- area.
I didn't find a better Resolution timers, so i'll guess i'll have to make do.

* - * - *
Tzahi Fadida

> -----Original Message-----
> From: Tzahi Fadida [mailto:[email-masked]]
> Sent: Saturday, December 14, 2002 8:58 PM
> To: [email-masked]
> Subject: [hackers-il] timming cpu time in windows
>
>
> hi all,
> the simple problems i give it, returns a zero time passed
> not platform specific, or at least for a pentium and win2000
> 10x
>
> * - * - *
> Tzahi Fadida
> To unsubscribe from this group, send an email to:
> [email-masked]
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>