ResetTimer
Jump to navigation
Jump to search
This function allows you to reset the value of the elapsed time in existing timers. The function resets the "execution time" value for timers with a limited number of repetitions.
Syntax
bool resetTimer ( timer theTimer )
OOP Syntax Help! I don't understand this!
- Method: timer:reset(...)
Required Arguments
- theTimer: The timer whose elapsed time you wish to reset.
Returns
Returns true if the timer was successfully reset, false otherwise.
Example
-- This example shows how you can reset timer by using /rtimer command.
local timerElement = false
function timerFunction()
print("Timer function executed at "..getTickCount())
end
timerElement = setTimer(timerFunction, 3000, 0)
function timerResetCommand()
local validTimer = isTimer(timerElement)
if validTimer then
print("Timer has been resetted.")
resetTimer(timerElement)
end
end
addCommandHandler("rtimer", timerResetCommand)
See Also
- addDebugHook
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace