diag tickTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(71 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Real time spent from the start of the game. Expressed in fractions of second. Resolution of 1 tick is 100nsecs |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| '''diag_tickTime''' |= Syntax
|game4= arma3
|version4= 0.50


|p1= |= PARAMETER1
|gr1= Diagnostic


|p2= |= PARAMETER2
|gr2= Time


|p3= |= PARAMETER3
|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}}.


| [[Number]] |= RETURNVALUE
|s1= [[diag_tickTime]]  


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


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


____________________________________________________________________________________________
|seealso= [[diag_fps]] [[diag_fpsMin]] [[diag_frameNo]] [[diag_log]] [[diag_deltaTime]] [[time]] [[systemTime]] [[systemTimeUTC]]
 
}}
| [[diag drawMode]], [[diag fps]], [[diag fpsmin]], [[diag frameno]], [[diag log]], [[diag toggle]] |= SEEALSO


|  |= MPBEHAVIOUR
<dl class="command_description">
____________________________________________________________________________________________
}}


<h3 style='display:none'>Notes</h3>
<dt></dt>
<dl class='command_description'>
<dd class="notedate">Posted on 25 Jan, 2014</dd>
<!-- Note Section BEGIN -->
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
In Arma 2 Operation Arrowhead 1.54.0.72888 this returns the time in seconds since the game was started. --[[User:Crowe|Crowe]] 19:28, 8 September 2010 (CEST)
<dd class="note">
<!-- Note Section END -->
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.
</dl>
</dl>


<h3 style='display:none'>Bottom Section</h3>
{{Note
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
|user= DreadedEntity
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|timestamp= 20220413232029
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|text= This command keeps incrementing if the player has paused the game, even in singleplayer. If time spent paused should not be considered, use [[time]]
}}

Latest revision as of 19:43, 3 September 2024

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