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

How to get interval in tenth of sec ?

 [1/6] from: coussement::c::itc::mil::be at: 18-Oct-2000 15:46

Librarian comment

time now has a /precise refinement that should solve this problem:

forever [wait 0,1 print now/time/precise]
Hi list: In the application i'm now developping, I need a mean to time a response interval to an item. I could use the classical : start-time: now/time delta-time: now/time - start-time but this produce a interval in seconds... I should need an interval in tenth of second ! Does REBOL/Core support any function like CPU ( ) in some other language ? Does anybody have any solution to this problem ? Thanks in advance !!! ;-) Christophe Coussement

 [2/6] from: eric:mccinc at: 18-Oct-2000 10:27

Sir, Time values less then a full second are expressed in decimal notation so that a hundredth of a second would be 00:00:00.01 and a thousandth would be 00:00:00:001 it seems to work out to millionsth of a second though at that level I am not sure how accurate it is on a standard pc.

 [3/6] from: larry:ecotope at: 18-Oct-2000 10:18

Hi Cristophe, The short answer is NO. Currently REBOL/Core/View can only return the system clock in seconds. With Command, you can access a C runtime DLL to get better resolution. Better time resolution has been requested on this mail-list, but I don't know if it is on the RT "to do" list. -Larry

 [4/6] from: list:brando:rebol at: 19-Oct-2000 2:30

---------- Forwarded message ---------- Date: Thu, 19 Oct 2000 08:58:10 +0200 From: "CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN" <[COUSSEMENT--C--ITC--mil--be]> To: [list--rebol--com] Subject: RE: [REBOL] How to get interval in tenth of sec ? Re: Larry, Thanks you for the answer, I will go for a Java or Javascript solution for now. I hope RT will release the enhancement soon. Capitaine C. COUSSEMENT Forces Armées Belges Centre de Recrutement et de Sélection Section de Recherche Psychologique Project Officer Computer Aided Testing Bruynstraat B-1120 BRUSSELS (N-O-H) BELGIUM *************************************************** e-mail: [coussement--c--itc--mil--be] ***************************************************

 [5/6] from: coussement:c:itc:mil:be at: 20-Oct-2000 9:09

Thanks all for the replies I got. it's quite unusal to post a reply to self but I think I got the solution to the earlier mention problem: just use the 'wait function with the right interval. forever [wait 0,1 print now/time] 9:16:16 9:16:16 9:16:16 9:16:16 9:16:17 9:16:17 9:16:17 9:16:17 9:16:17 9:16:17 9:16:17 9:16:17 9:16:17 9:16:17 9:16:18 9:16:18 As there are 10 calls/sec, the result is what I searched for. Now it's easy to build an interval func. Hope this helps someone ! Kind regards, ;-) Christophe

 [6/6] from: norsepower:uswest at: 20-Oct-2000 8:50

This is true if your CPU is not undertaking any other additional activity. If you were to run the same statement with the cpu under load, the result would be different. -Ryan