resetTimer
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
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.
OOP Syntax Help! I don't understand this!
- Method: timer:reset(...)
Syntax
bool resetTimer ( timer theTimer )Required Arguments
- theTimer: The timer whose elapsed time you wish to reset.
Returns
- bool: value
Returns true if the timer was successfully reset, false otherwise.
Code Examples
shared
-- This example shows how you can reset timer by using /rtimer command.
local timerElement = false
function timerFunction() print("Timer function executed at "..getTickCount())endtimerElement = setTimer(timerFunction, 3000, 0)
function timerResetCommand() local validTimer = isTimer(timerElement)
if validTimer then print("Timer has been resetted.") resetTimer(timerElement) endendaddCommandHandler("rtimer", timerResetCommand)See Also
Utility Functions
- addDebugHook
- bitAnd
- bitArShift
- bitExtract
- bitLRotate
- bitLShift
- bitNot
- bitOr
- bitReplace
- bitRRotate
- bitRShift
- bitTest
- bitXor
- createTrayNotification
- debugSleep
- decodeString
- deref
- downloadFile
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getKeyboardLayout
- getLocalization
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getProcessMemoryStats
- getRealTime
- getServerIp
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTimer
- isTimerPaused
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- ref
- removeDebugHook
- resetTimer
- setClipboard
- setDevelopmentMode
- setFPSLimit
- setTimer
- setTimerPaused
- setTransferBoxVisible
- setWindowFlashing
- sha256
- showCol
- showSound
- split
- teaDecode
- teaEncode
- tocolor
- toJSON
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub