Difference between revisions of "LlGetAndResetTime"

From Second Life Wiki
Jump to navigation Jump to search
m
m (formatted example)
Line 15: Line 15:
**Call to either [[llResetTime]] or [[llGetAndResetTime]]
**Call to either [[llResetTime]] or [[llGetAndResetTime]]
*Script time doesn't measure real world time, it is affected by time dilation.
*Script time doesn't measure real world time, it is affected by time dilation.
|examples=<pre>
|examples=<lsl>
default {
default {
     state_entry()
     state_entry()
Line 27: Line 27:
     }
     }
}
}
</pre>
</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llResetTime]]|}}
|also_functions={{LSL DefineRow||[[llResetTime]]|}}

Revision as of 14:59, 18 February 2008

Summary

Function: float llGetAndResetTime( );
0.0 Forced Delay
10.0 Energy

Returns a float that is script time in seconds and then resets the script time to zero.

Specification

Script time differs from normal time, it is affected by time dilation. See llGetRegionTimeDilation for details.

Caveats

Examples

<lsl> default {

   state_entry()
   {
       llResetTime();
   }
   touch_start(integer num_touch)
   {
       float time = llGetAndResetTime(); //This is equivalent to calling llGetTime(), then llResetTime()     
       llSay(0,(string)time + " seconds have elapsed since the last touch." );
   }

}

</lsl>

Notes

Script time does not measure time dilation. To measure elapsed calendar time, call llGetTimestamp instead, since time dilation and resets often make dilated time intervals differ from calendar time intervals.

See Also

Functions

•  llResetTime
•  llGetTime
•  llGetRegionTimeDilation

Deep Notes

Signature

function float llGetAndResetTime();