PowerBASIC Users Meeting Point
Comments re High resolution replacement for Sleep - Printable Version

+- PowerBASIC Users Meeting Point (http://pump.richheimer.de)
+-- Forum: User to User Discussions (http://pump.richheimer.de/forumdisplay.php?fid=3)
+--- Forum: Programming (http://pump.richheimer.de/forumdisplay.php?fid=7)
+--- Thread: Comments re High resolution replacement for Sleep (/showthread.php?tid=74)

Pages: 1 2


RE: Comments re High resolution replacement for Sleep - Stuart McLachlan - 09-14-2025

(09-14-2025, 12:29 PM)Dale Yarker Wrote: CPU Base Frequency = 27.12 GHz

Wow! Just Wow!  Smile

Three times as fast as:
Intel Core i9-14900KF is the fastest PC CPU by base frequency, with a world record of 9.13 GHz achieved through extreme overclocking with liquid helium

(or was that 2.712 GHz? )


RE: Comments re High resolution replacement for Sleep - Dale Yarker - 09-14-2025

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.


RE: Comments re High resolution replacement for Sleep - David Roberts - 09-14-2025

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.