Difference between revisions of "Time Module"

From SolarStrike wiki
Jump to: navigation, search
m (Protected "Timer Module" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(diff)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== getNow() ==
+
== getNow ==
'''int64 timer.getNow()'''
+
'''number time.getNow()'''
  
Returns the current high-precision time as an int64 table.
+
Returns the current high-precision time as an int64.
  
  
== deltaTime() ==
+
== deltaTime ==
'''number timer.deltaTime()'''
+
'''number time.deltaTime()'''
  
Returns the deltaTime for the current logic cycle
+
Returns the deltaTime (amount of time in seconds [including fractions] since last cycle) for the current logic cycle
  
  
== diff() ==
+
== diff ==
'''number timer.diff(int64 t2, int64 t1)'''
+
'''number time.diff(number t1)'''
  
Compares two high-precision time values (from timer.getNow()) and returns the amount of time that has elapsed between them in seconds.
+
'''number time.diff(number t2, number t1)'''
 +
 
 +
Compares two high-precision time values (from time.getNow()) and returns the amount of time that has elapsed between them in seconds.
 +
If only 't2' is given, then 't1' is assumed to be 'now'.

Latest revision as of 03:51, 18 February 2015

getNow

number time.getNow()

Returns the current high-precision time as an int64.


deltaTime

number time.deltaTime()

Returns the deltaTime (amount of time in seconds [including fractions] since last cycle) for the current logic cycle


diff

number time.diff(number t1)

number time.diff(number t2, number t1)

Compares two high-precision time values (from time.getNow()) and returns the amount of time that has elapsed between them in seconds. If only 't2' is given, then 't1' is assumed to be 'now'.