Don't click here unless you want to be banned.

LSL Wiki : llGetAndResetTime

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
float llGetAndResetTime()

Gets the time in seconds since the last script reset (or the last call to this function or llResetTime) and resets the time to zero. This offers greater precision than calling llGetTime and llResetTime separately.

Example:
default
{
    touch_start( integer total_number )
    {
        float elapsed = llGetAndResetTime();
        float deadline = 10.0;

        if ( elapsed >= deadline )
            llWhisper( 0, "I'm sorry, you were too slow: " 
                          + (string)elapsed 
                          + " seconds" );       
        else 
            llWhisper( 0, "Yay!  You beat the deadline by " 
                          + (string)(deadline - elapsed)
                          + " seconds" );
    }
}


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Time
There is no comment on this page. [Display comments/form]