diag tickTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *T([a-z ])" to "$1 - t$2")
 
(3 intermediate revisions by the same user not shown)
Line 17: Line 17:
|gr2= Time
|gr2= Time


|descr= Real time in seconds spent from the start of the game. On Windows the command uses [https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timegettime timeGetTime].
|descr= Real time in seconds spent from the start of the game. On Windows the command uses {{Link|https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timegettime|timeGetTime}}.


|s1= [[diag_tickTime]]  
|s1= [[diag_tickTime]]  


|r1= [[Number]] - Time in seconds from game start
|r1= [[Number]] - time in seconds from game start


|x1= <code>// Measure execution time of a script
|x1= <sqf>// Measure execution time of a script
_start = diag_tickTime;
_start = diag_tickTime;
// code
// code
_stop = [[diag_tickTime]];
_stop = diag_tickTime;
diag_log format ["%1",_stop - _start];</code>
diag_log format ["%1",_stop - _start];</sqf>


|seealso= [[diag_fps]] [[diag_fpsMin]] [[diag_frameNo]] [[diag_log]] [[diag_deltaTime]] [[time]] [[systemTime]] [[systemTimeUTC]]
|seealso= [[diag_fps]] [[diag_fpsMin]] [[diag_frameNo]] [[diag_log]] [[diag_deltaTime]] [[time]] [[systemTime]] [[systemTimeUTC]]

Latest revision as of 16:50, 8 November 2023

Hover & click on the images for description

Description

Description:
Real time in seconds spent from the start of the game. On Windows the command uses timeGetTime.
Groups:
DiagnosticTime

Syntax

Syntax:
diag_tickTime
Return Value:
Number - time in seconds from game start

Examples

Example 1:
// Measure execution time of a script _start = diag_tickTime; // code _stop = diag_tickTime; diag_log format ["%1",_stop - _start];

Additional Information

See also:
diag_fps diag_fpsMin diag_frameNo diag_log diag_deltaTime time systemTime systemTimeUTC

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 25 Jan, 2014
Killzone_Kid
This command will return time since last client restart as float. However because of Number format used in Arma, the more time has past since restart the less precise the returned value will be.
DreadedEntity - c
Posted on Apr 13, 2022 - 23:20 (UTC)
This command keeps incrementing if the player has paused the game, even in singleplayer. If time spent paused should not be considered, use time