LSL Wiki Mirror 7-7-7 : llGetTime

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
float llGetTime()

Gets the time in seconds since the last script reset, or since the time was last reset using llResetTime or llGetAndResetTime. It has been reported that it can also reset when the server reboots or other unusual events. Because of this, it works best for measuring short intervals (e.g. "Has it been over three seconds since I was last clicked?"), and may be unreliable over long intervals (e.g. "Has is been over three days since I was last clicked?").

Note: llGetTime, llGetTimeOfDay, llGetWallclock, and llGetGMTclock do different things.

The following script reports the script's lifetime each time the object is touched:
default
{
    touch_start( integer total_number )
    {
        float lifetime = llGetTime();
        llWhisper( 0, "This script has been running for " 
                      + (string)lifetime 
                      + " seconds" );
    }
}


Functions | Time
There are 4 comments on this page. [Display comments/form]