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

LSL Wiki : llGetAndResetTime

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawling22.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" );
    }
}


Functions | Time
Comments [Hide comments/form]
Attach a comment to this page: