Difference between revisions of "LlGetAndResetTime"

From Second Life Wiki
Jump to navigation Jump to search
(Removed superfluous state_entry with its llResetTime() . Time is automatically reset on script start. llSay(0, is far more widely used and understood than PUBIC_CHANNEL)
m
Line 13: Line 13:
**Script reset (user or [[llResetScript]] or [[llResetOtherScript]])
**Script reset (user or [[llResetScript]] or [[llResetOtherScript]])
**Call to either [[llResetTime]] or [[llGetAndResetTime]]
**Call to either [[llResetTime]] or [[llGetAndResetTime]]
|examples=<lsl>
|examples=<source lang="lsl2">
default
default
{
{
Line 24: Line 24:
     }
     }
}
}
</lsl>
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llResetTime]]|}}
|also_functions={{LSL DefineRow||[[llResetTime]]|}}

Revision as of 00:36, 22 January 2015

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 is the amount of time the script has been running since it first started, was most recently reset, or one of the reset functions was called. It is unaffected by time dilation.

Caveats

Examples

default
{
    touch_start(integer num_touch)
    {
        // This is equivalent to calling llGetTime(), then llResetTime()
        float time = llGetAndResetTime();

        llSay(0, (string)time + " seconds have elapsed since the last touch or boot-up.");
    }
}

Notes

Script time is the amount of real-world time that the script has been in a running state. It is unaffected by time dilation, but it does not count time while the script is suspended, the user is offline (when in an attachment), the object is in inventory rather than rezzed, etc.

See Also

Functions

•  llResetTime
•  llGetTime
•  llGetRegionTimeDilation

Deep Notes

Signature

function float llGetAndResetTime();