Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 15 APR 1998 01:45:10PM Dsig (SigSOlutions) wrote:

I am sure this has been talked about before .. but how does one get time in greater degrees than seconds?

There used to be a dostime function but it does not seem to be there.

We have the need to time server access and need greater resolution than seconds ..

any ideas

dsig

David Tod Sigafoos ~ SigSolutions

dsig@teleport.com cis:70302,77 voice: 503-639-8080


At 15 APR 1998 03:16PM John Duquette wrote:

Dave,

Have you tried the timer property/timer event? It can time in milliseconds.

John Revelation


At 15 APR 1998 04:31PM Cameron Purdy wrote:

dsig,

how does one get time in greater degrees than seconds?

For a date/time value precise to the second:

* in OpenInsight v3.6

declare function datetime

dt_val=datetime()

For a date/time value more precise than to the second:

* in all versions of OpenInsight and in Arev too

declare subroutine dostime

dostime(dt_val)

For simply determining the passage of time, however, use the Windows API GetTickCount() function, which returns the number of milliseconds that Windows has been running, and is efficient and precise to 1/18 of a second:

function test_time(iters)

declare function GetTickCount

if assigned(iters) else iters="

if num(iters) and len(iters) else return "Pass iteration count"

t0=GetTickCount()

for i=1 to iters

* put test here

next i

t1=GetTickCount()

secs=((t1-t0)/1000)

return "Performed ": iters: " iterations in ": secs: " seconds; average=: fmt(secs/iters*10000, "MD5")

… for output such as:

Performed 10 iterations in 2.462 seconds; average=.02462

Cameron Purdy

info@revelation.com


At 15 APR 1998 07:26PM Dsig (SigSolutions) wrote:

Cameron,

Thanks for the quick response ..

SHAME ON ME for forgetting that DosTime was a sub not a function .. no matter how I tried it just didn't want to return stuff to me :-)

Shame on RTI for not having it in the docs (at least on line).

Just so you know .. and I am sure that you have been waiting at your desk for this reponse .. the difference between dostime and gettickcount (so where was that doc'd :-) is as follows:

for 1 million iterations

dostime=11.1999999999971

gettickcount=11.207

so where did that .0070000000029 go anyway :-)

thanks again .. you're the cats meow

dsig

David Tod Sigafoos ~ SigSolutions

dsig@teleport.com cis:70302,77 voice: 503-639-8080


At 15 APR 1998 07:32PM DSig (SigSolutions) wrote:

John,

thanks for the quick response ..

I looked at the timer BUT it seems to be a 'countdown to event' type of thing. What I needed as a way to see the duration of a process .. you know the start/end time thing. Although I have used timers I could not figure a way to get this type of behavior .. if I missed something please let me know as I love to learn new things

But things would have been much easier if I HAD NOT FORGOTTEN that dostime was a sub not a function ..

Could you see about getting dostime and gettickcount doc'd in the next help file ..

thanks again

dsig

David Tod Sigafoos ~ SigSolutions

dsig@teleport.com cis:70302,77 voice: 503-639-8080


At 16 APR 1998 09:32AM John Duquette wrote:

We learn something new every day

Shame on me for not looking in the source..

I'll put it in the SPR as a doc issue today.

jd


At 16 APR 1998 10:42AM Cameron Purdy wrote:

dsig,

GetTickCount is only correct to 55 ms.

Cameron Purdy

info@revelation.com

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/1effdba88b1f3487852565e7006184dc.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1