GetCurrentRealTime - Utility

Revision as of 11:46, 8 October 2012 by imported>Perdev (Undo revision 34340 by Perdev (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: Utility Script

Gets the number of real-world seconds that have elapsed since the game has launched. This time does not count time the game has been alt-tabbed, or other cases where the game has been frozen (i.e. during a save or load, time in a menu is counted). This function is most useful for timing a long operation.

SyntaxEdit

float Function GetCurrentRealTime() native

ParametersEdit

None.

Return ValueEdit

The number of seconds since the game has been launched.

ExamplesEdit

; How long does our operation take?
float ftimeStart = Utility.GetCurrentRealTime()
; Long operation here
float ftimeEnd = Utility.GetCurrentRealTime()
Debug.Trace("We took " + (ftimeEnd - ftimeStart) + " seconds to run")

See AlsoEdit