308
edits
(Added maketimestamp()) |
|||
Line 1,833: | Line 1,833: | ||
timer.singleShot = 1; | timer.singleShot = 1; | ||
timer.start(); | timer.start(); | ||
}} | |||
=== maketimestamp() === | |||
{{Nasal doc | |||
|syntax = maketimestamp()); | |||
|source = ''Implemented using the {{API Link|flightgear|class|TimeStampObj}} class.''<br>{{flightgear file|src/Scripting/NasalSys.cxx|l=214|t=Part 1}} {{!}} {{flightgear file|src/Scripting/NasalSys.cxx|l=602|t=Part 2}} | |||
|version = 2019.2 | |||
|commit = {{flightgear commit|704c193b8ea101ab6b3e2dfcf20bafe37282d99b|t=commit}} | |||
|text = Returns a time stamp object to allow high resolution timing of Nasal operations containing the following methods and members: | |||
* '''stamp()''': Resets the timing operation. Call this first. | |||
* '''elapsedMSec()''': returns number of milliseconds elapsed since stamp() called. Resolution may vary depending on platform but is usually at least millisecond accuracy. | |||
| | |||
|example1text = In the example below the number of milliseconds elapsed will be printed. | |||
|example1 = var timestamp = maketimestamp(); | |||
timestamp.stamp(); | |||
print(timestamp.elapsedMSec(), "ms elapsed"); | |||
print(timestamp.elapsedMSec(), "ms elapsed"); | |||
}} | }} | ||
edits