Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange ERROR!!!!!!!!!!!!!????????????? Pin
Richard MacCutchan12-May-13 3:54
mveRichard MacCutchan12-May-13 3:54 
GeneralRe: Strange ERROR!!!!!!!!!!!!!????????????? Pin
OmarSH12-May-13 4:11
OmarSH12-May-13 4:11 
GeneralRe: Strange ERROR!!!!!!!!!!!!!????????????? Pin
Richard MacCutchan12-May-13 4:17
mveRichard MacCutchan12-May-13 4:17 
QuestionRe: Strange ERROR!!!!!!!!!!!!!????????????? Pin
David Crow13-May-13 4:53
David Crow13-May-13 4:53 
QuestionMicrosecond Timer Pin
Stephane3410-May-13 10:24
Stephane3410-May-13 10:24 
AnswerRe: Microsecond Timer Pin
dusty_dex10-May-13 10:33
dusty_dex10-May-13 10:33 
GeneralRe: Microsecond Timer Pin
Stephane3410-May-13 10:46
Stephane3410-May-13 10:46 
GeneralRe: Microsecond Timer Pin
dusty_dex10-May-13 11:24
dusty_dex10-May-13 11:24 
You did understand what you were told in VB forum?

Windows will interrupt your code whether you want it to or not. That is what is meant by 'pre-emptive' Operating System.

The windows scheduler has a resolution of about 15ms and it will mess up all attempts to get reliable timing shorter than what the scheduler has. Believe me this is not a trivial task. see here.

I also prefer to use the following method..
"If you do a Sleep(), you might hope that when you regain control you are probably pretty soon after a clock tick. So assume that, reading the counter immediately after a Sleep(), and repeat several times, taking the earliest counter value recorded to be the counter value at the tick. This method will have a small but hopefully constant offset; it's the best we can do, at least in user space (more may be possible as a driver, using the DDK KeQuery* functions; we haven't investigated this)."

I just average a counter over several milliseconds (less than the quantum of the scheduler's 15ms) and divide it by 1,000 or 1,000,000 to get a rough sub-ms delay. Not ideal but it obtains a reliable value when the NT scheduler is running.

there is some downloadable C source code from the following link.
www.lochan.org/2005/keith-cl/useful/win32time.html



modified 10-May-13 17:45pm.

AnswerRe: Microsecond Timer Pin
Erudite_Eric12-May-13 2:16
Erudite_Eric12-May-13 2:16 
Questionoverloading in C++ Pin
OmarSH10-May-13 7:48
OmarSH10-May-13 7:48 
AnswerRe: overloading in C++ Pin
Chris Losinger10-May-13 9:31
professionalChris Losinger10-May-13 9:31 
AnswerRe: overloading in C++ Pin
«_Superman_»10-May-13 19:59
professional«_Superman_»10-May-13 19:59 
GeneralRe: overloading in C++ Pin
OmarSH10-May-13 23:11
OmarSH10-May-13 23:11 
GeneralRe: overloading in C++ Pin
«_Superman_»11-May-13 1:51
professional«_Superman_»11-May-13 1:51 
GeneralRe: overloading in C++ Pin
OmarSH11-May-13 2:11
OmarSH11-May-13 2:11 
GeneralRe: overloading in C++ Pin
«_Superman_»12-May-13 5:00
professional«_Superman_»12-May-13 5:00 
QuestionWhere is IACLCustomMRU declared ? Pin
jeff610-May-13 7:07
jeff610-May-13 7:07 
AnswerRe: Where is IACLCustomMRU declared ? Pin
Richard MacCutchan10-May-13 22:05
mveRichard MacCutchan10-May-13 22:05 
GeneralRe: Where is IACLCustomMRU declared ? Pin
jeff610-May-13 23:21
jeff610-May-13 23:21 
GeneralRe: Where is IACLCustomMRU declared ? Pin
Richard MacCutchan10-May-13 23:52
mveRichard MacCutchan10-May-13 23:52 
QuestionHOW to make GUI in C++ Pin
OmarSH10-May-13 6:33
OmarSH10-May-13 6:33 
AnswerRe: HOW to make GUI in C++ Pin
David Crow10-May-13 7:19
David Crow10-May-13 7:19 
AnswerRe: HOW to make GUI in C++ Pin
«_Superman_»10-May-13 20:07
professional«_Superman_»10-May-13 20:07 
GeneralRe: HOW to make GUI in C++ Pin
Richard MacCutchan10-May-13 22:04
mveRichard MacCutchan10-May-13 22:04 
GeneralRe: HOW to make GUI in C++ Pin
ThatsAlok21-May-13 0:01
ThatsAlok21-May-13 0:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.