WakeupAt (System function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (minor cleanup) |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:System:WakeupAt subtitle}} | {{Template:System:WakeupAt subtitle}} | ||
The <var>[[WakeupAt (System function)|WakeupAt]]</var> function is an enhanced alternative | The <var>[[WakeupAt (System function)|WakeupAt]]</var> function is an enhanced alternative | ||
as the User Language <var>Pause</var> statement, allowing wakeup time resolution of 1 millisecond, | as the <var class="product">User Language</var> <var>Pause</var> statement, allowing wakeup time resolution of 1 millisecond, | ||
and returns the current time in milliseconds. | and returns the current time in milliseconds. | ||
==Syntax== | ==Syntax== | ||
Line 9: | Line 8: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%number</th><td>The current time, after waking up, in milliseconds.</td></tr> | <tr><th>%number</th><td>The current time, after waking up, in milliseconds.</td></tr> | ||
<tr><th nowrap="true"><var>%(System)</var></th> | <tr><th nowrap="true"><var class="nobr">%(System)</var></th> | ||
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>WakeupAt</var> can also be invoked via a <var>System</var> object variable, which may be <var>Null</var>.</td></tr> | <td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>WakeupAt</var> can also be invoked via a <var>System</var> object variable, which may be <var>Null</var>.</td></tr> | ||
<tr><th>timeInMilliseconds</th> | <tr><th>timeInMilliseconds</th> | ||
<td>The time, in milliseconds, at which to wake up.</td></tr> | <td>The time, in milliseconds, at which to wake up. This may not be more than 12 hours in the future. </td></tr> | ||
</table> | </table> | ||
==Examples== | ==Examples== | ||
The following code fragment pauses for 1 second at the start of each iteration of the <var>Repeat</var> loop: | The following code fragment pauses for 1 second at the start of each iteration of the <var>Repeat</var> loop: | ||
Line 21: | Line 19: | ||
repeat | repeat | ||
%time = %time + 1000 | %time = %time + 1000 | ||
%time = %(system):wakeupAt(%time) | |||
</p> | </p> | ||
==See also== | ==See also== | ||
{{Template:System:WakeupAt footer}} | {{Template:System:WakeupAt footer}} |
Latest revision as of 16:30, 4 January 2016
Wake up at a specific time in milliseconds (System class)
[Introduced in Sirius Mods 7.9]
The WakeupAt function is an enhanced alternative as the User Language Pause statement, allowing wakeup time resolution of 1 millisecond, and returns the current time in milliseconds.
Syntax
[%number =] %(System):WakeupAt( timeInMilliseconds)
Syntax terms
%number | The current time, after waking up, in milliseconds. |
---|---|
%(System) | The class name in parentheses denotes a shared method. WakeupAt can also be invoked via a System object variable, which may be Null. |
timeInMilliseconds | The time, in milliseconds, at which to wake up. This may not be more than 12 hours in the future. |
Examples
The following code fragment pauses for 1 second at the start of each iteration of the Repeat loop:
%time = %(system):currentTimeMilliseconds repeat %time = %time + 1000 %time = %(system):wakeupAt(%time)