@Danilo - HiResTimer

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

Hi Danilo, in a previous email you said you would be providing documentation for the timer library. Could you tell me where to get it?

Thanks
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Topic: viewtopic.php?t=4323">http://forums.pur ... search.asp

cya,
...Danilo
(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

Oh, that was it! Sorry, thought there might have been more functions/ changes. Ta.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by vanleth.

Cheers, didn't either know about those commands. Using them now with great success.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

I´m rewriting some of this stuff atm and make
docs for everything.
57 commands ready and documented so far...
more will follow (i´m sitting here right NOW
to do some stuff).
Release will be when its ready for release... :)

cya,
...Danilo
(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by JohnDeHope3.

Is this the best way to do this...

Global TimerTicks.l
Procedure TimerTick()
TimerTicks + 1
If TimerTicks < 0 : TimerTicks = 0 : EndIf
EndProcedure
OpenConsole()
StartTimer(0,50,@TimerTick())
Repeat
Key.s = Inkey()
If Left(Key,1) = "t" : PrintN("Timer: " + Str(TimerTicks)) : EndIf
Until Left(Key,1) = "q"

In other words, I want a stand-alone global variable that I can look at, any time, and see the number of timer ticks since I started the timer. If the timertick variable flips over (due to the limited amount of numbers in a long integer) it resets to zero. This works, I am just wondering if it is the most efficient. Mainly I don't like checking for the flip every time the timer fires, that seems like *a lot* of code running all the time in the background for such a mundane thing.
Post Reply