Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-01-2010, 23:06
Enigma Enigma is offline
Developer
 
Join Date: Oct 2009
Posts: 30
Rept. Given: 0
Rept. Rcvd 23 Times in 8 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
Enigma Reputation: 23
GetTickCount lies??

Hi guys!

Have faced some very interesting problem with GetTickCount.

Imagine I placed to the thread, in some endless loop, such code:
Code:
x = GetTickCount;
Sleep(1000);
x = GetTickCount - x;
What do you think the "x" contains? Usually this is value >= 1000, but sometimes it is 999, and more curious, sometimes it is 998. Tested with 997 and looks like this never happens.

Do you know why after 1000 milliseconds sleep GetTickCount shows 998 milliseconds difference?
Reply With Quote
 

Tags
sleep, time


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 14:30.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )