09-14-2025, 01:00 PM
(This post was last modified: 09-14-2025, 01:04 PM by Stuart McLachlan.)
Comments re High resolution replacement for Sleep
|
09-14-2025, 01:44 PM
Oops, fixed in post.
It is 2.712 GHz. Was even thinking 2.712 while placing decimal to get rid of all the zeros the console used. T.A.
09-14-2025, 05:34 PM
(This post was last modified: 09-14-2025, 06:02 PM by David Roberts.)
This is how it works when n>3
|----- Sleep ( n-3 ) -----|-Poll Tix-| Sleep ( n-3 ) has a resolution of 1ms by virtue of SetHiRes. However its value will vary between just over (n-3 )ms and about (n-3+1.5)ms and not the theoretical expectation of (n-3+1). So Sleep ( n-3 ) is a variable of an unknown quantity and has no CPU Load. Sleep (n-3 ) + Poll Tix = qTarget. It follows then 'Poll Tix' is also a variable of an unknown quantity but has a CPU Load. If we rip out Sleep ( n-3 ) then we are reduced to polling Tix for the whole of the delay. For 'long' delays one of our cores will be running flat out and this may impact on our system performance. One guy at FreeBASIC only polled Timer, and therefore the Performance Counter, and reckoned that worked for him. With a five-second delay, for example, and a quad-core, one of his cores would suffer a 25% CPU Load hit. That is huge. With Sleep (n-3 ) there would be no CPU Load associated with the delay for about five seconds minus about 3ms. A CPU Load would kick in for about 3ms which is negligible. |
« Next Oldest | Next Newest »
|
Users browsing this thread: 2 Guest(s)