Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: forever loops and cpu usage

From: lmecir:mbox:vol:cz at: 8-Feb-2004 21:59

Paul Tretter napsal(a):
>On WinXP here I can get as precise as .001 on the wait time. However, it >appears that anything less than that storms the cpu back up to 99 percent. >I suppose that .001 is the lowest number that the wait function can support. >I'm curious why you arrived at .002. Was it the balance point for windows >and linux. I would like others to report on what OS they use and report >their findings. HOW LOW CAN YOU GO? >
I have got a timing function working as follows: tick-time: time-tick 0.1 ; == 1.00000000002183E-2 , which computes the internal system timer resolution, 0.1 is an argument asking for 10% relative error at most. Other results:
>> time-block [wait 0.02] 0,05
== 2.00312500001019E-2
>> time-block [wait 0.01] 0,05
== 1.00156250000509E-2
>> time-block [wait 0.005] 0,05
== 1.00156250000509E-2
>> time-block [wait 0.002] 0,05
== 1.00156249998236E-2
>> time-block [wait 0.001] 0,05
== 1.00117187499791E-2 look like showing, that all below the system timer resolution are rounded up to the system timer. OTOH, times below 0.001 exhibit this:
>> time-block [wait 0.00099] 0,05
== 4.85229492186434E-6 -L