Skip to main content

Timed

Functions

constructor

function constructor(
uint256 _duration
) internal

Parameters

NameTypeDescription
_durationuint256

isTimeEnded

function isTimeEnded() public returns (bool)

return true if time period has ended

remainingTime

function remainingTime() public returns (uint256)

number of seconds remaining until time is up

Return Values

NameTypeDescription
[0]uint256remaining

timeSinceStart

function timeSinceStart() public returns (uint256)

number of seconds since contract was initialized

will be less than or equal to duration

Return Values

NameTypeDescription
[0]uint256timestamp

isTimeStarted

function isTimeStarted() public returns (bool)

_initTimed

function _initTimed() internal

_setDuration

function _setDuration(
uint256 newDuration
) internal

Parameters

NameTypeDescription
newDurationuint256

Events

DurationUpdate

event DurationUpdate(
uint256 oldDuration,
uint256 newDuration
)

Parameters

NameTypeDescription
oldDurationuint256
newDurationuint256

TimerReset

event TimerReset(
uint256 startTime
)

Parameters

NameTypeDescription
startTimeuint256