LuaDocs/Timer

From Data Realms Wiki

Jump to: navigation, search

Contents

Has no parent class

Generic Class. A precise timer for FPS synch etc.

Go back to Class Index


Properties

StartRealTimeMS

The start real time value of this Timer.A __int64 value that represents the amount of real time in ms from when windows was started to when Reset() of this Timer was called.

ElapsedRealTimeS

The elapsed real time in seconds since this Timer was Reset().A double value that represents the elapsed real time since Reset() in s.

ElapsedRealTimeMS

The elapsed real time in ms since this Timer was Reset().A unsigned long value that represents the elapsed real time since Reset() in ms.

StartSimTimeMS

The start time value of this Timer.A __int64 value that represents the amount of time in ticks from when windows was started to when Reset() of this Timer was called.

ElapsedSimTimeS

The elapsed time in s since this Timer was Reset().A unsigned long value that represents the elapsed time since Reset() in s.

ElapsedSimTimeMS

The elapsed time in ms since this Timer was Reset().A unsigned long value that represents the elapsed time since Reset() in ms.


Functions

SetRealTimeLimitMS

Sets the real time limit value of this Timer, RELATVE to the start time. This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.

Arguments:

  • A positive double with the new real time limit relative to the start time.

Return value:

None.


SetRealTimeLimitS

Sets the real time limit value of this Timer, RELATVE to the start time. This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.

Arguments:

  • A positive double with the new real time limit relative to the start time.

Return value:

None.


IsPastRealTimeLimit

Returns true if the elapsed real time is past a certain amount of time after the start previously set by SetRealTimeLimit.

Arguments:

  • An unsigned long specifying the threshold amount of real time in ms.

Return value:

A bool only yielding true if the elapsed real time is greater than the set limit value. If no limit has been set, this returns false.


LeftTillRealTimeLimitMS

Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetRealTimeLimitMS.

Arguments:

  • None.

Return value:

A unsigned long with the real time left till the passed in value, or negative if this Timer is already past that point in time.


LeftTillRealTimeLimitS

Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetRealTimeLimitS.

Arguments:

  • None.

Return value:

A unsigned long with the real time left till the passed in value, or negative if this Timer is already past that point in time.


LeftTillRealMS

Returns how much time in ms that there is left till this Timer reaches a certain time limit.

Arguments:

  • A unsigned long specifying till when there is time.

Return value:

A unsigned long with the time left till the passed in value, or negative if this Timer is already past that point in time.


IsPastRealMS

Returns true if the elapsed real time is past a certain amount of time relative to this' start.

Arguments:

  • A long specifying the threshold amount of real time in ms.

Return value:

A bool only yielding true if the elapsed real time is greater than the passed in value.


AlternateReal

Returns true or false, depending on whether the elapsed time falls in one of two repeating intervals which divide it. This is useful for blink animations etc.

Arguments:

  • An int with the alternating period in ms. The time specified here is how long it will take for the switch to alternate.

Return value:

Whether the elapsed time is in the first state or not.


SetSimTimeLimitMS

Sets the sim time limit value of this Timer, RELATVE to the start time. This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.

Arguments:

  • A positive double with the new sim time limit relative to the start time.

Return value:

None.


SetSimTimeLimitS

Sets the sim time limit value of this Timer, RELATVE to the start time. This is when the timer is supposed to show that it has 'expired' or reached whatever time limit it is supposed to keep track of.

Arguments:

  • A positive double with the new sim time limit relative to the start time.

Return value:

None.


LeftTillSimTimeLimitMS

Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetSimTimeLimitMS.

Arguments:

  • None.

Return value:

A unsigned long with the sim time left till the passed in value, or negative if this Timer is already past that point in time.


LeftTillSimTimeLimitS

Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetSimTimeLimitS.

Arguments:

  • None.

Return value:

A unsigned long with the sim time left till the passed in value, or negative if this Timer is already past that point in time.


LeftTillSimMS

Returns how much time in ms that there is left till this Timer reaches a certain time limit.

Arguments:

  • A unsigned long specifying till when there is time.

Return value:

A unsigned long with the time left till the passed in value, or negative if this Timer is already past that point in time.


IsPastSimMS

Returns true if the elapsed time is past a certain amount of time.

Arguments:

  • A unsigned long specifying the threshold amount of time in ms.

Return value:

A bool only yielding true if the elapsed time is greater than the passed in value.


AlternateSim

Returns true or false, depending on whether the elapsed time falls in one of two repeating intervals which divide it. This is useful for blink animations etc.

Arguments:

  • An int with the alternating period in ms. The time specified here is how long it will take for the switch to alternate.

Return value:

Whether the elapsed time is in the first state or not.


Go back to Class Index

Personal tools