Template:Needs Translation/
函数名
|
Function: float llGetAndResetTime( )
|
无
|
返回值:返回一个以秒为单位的脚本时间浮点数,然后将脚本时间重置为零。
|
注意事项
|
注意事项
- 脚本时间是脚本处于运行状态的实际时间。它不受时间膨胀的影响,但它不计算脚本挂起、用户脱机(在附件中)、对象在库存中而不是rezzed等情况下的时间。
- 脚本时间重置时…
- 脚本重置(user或llResetScript或llResetOtherScript)
- 调用llResetTime或llGetAndResetTime
- 由于(32位)浮点数的限制,该函数的精度为1/32秒~3天,1/16秒~6天,等等…每次翻倍,例如在194天左右,只有1秒。在实际操作时使用llResetTime或llGetAndResetTime以保持所需的精度。
|
示例
|
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.");
}
}
|