Subject: RE: [hackers-il] timming cpu time in windows

From: "Arik Baratz" <[email-masked]>
Date: Sun, 15 Dec 2002 16:51:00 +0200

GetSystemTime - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemtime.asp - gets you millisecond resolution

If you need a better resolution, go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/high_resolution_timer.asp which has a 20 microsecond resolution or so.

-- Arik

> -----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,
> 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
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> ---------------------~-->
> Get 128 Bit SSL Encryption!
> http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/saFolB/TM
> --------------------------------------------------------------
> -------~->
> 
> 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/

---

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

yes, queryperformancecounter did the trick. i tried it before, but i thought at first
it required special
hardware to work. there is only one problem i am not sure about. it uses
large_interger which
is a 64 bit in the quadpart.
what lowgrade platforms can do 64bit? aside from my pentium III
pentium2? pentium?

* - * - *
Tzahi Fadida

WARNING TO SPAMMERS:  see at http://members.lycos.co.uk/my2nis/spamwarning.html

> From: Arik Baratz [mailto:[email-masked]]
> Sent: Sunday, December 15, 2002 4:51 PM
> Subject: RE: [hackers-il] timming cpu time in windows
>
>
>
> GetSystemTime -
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/ba
> se/getsystemtime.asp - gets you millisecond resolution
>
> If you need a better resolution, go to
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/ba
se/high_resolution_timer.asp which has a 20 microsecond resolution or so
> > 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
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>