Anonymous
public text v1 · immutableon *:TEXT:!start:#:{
if (%stopwatch.start) {
msg $chan There is already an active stopwatch.
}
else {
set %stopwatch.start $ctime
msg $chan Stopwatch started.
}
}
on *:TEXT:!stop:#:{
if (!%stopwatch.start) {
msg $chan There is not an active stopwatch.
}
else {
var %dur = $duration($calc($ctime - %stopwatch.start))
unset %stopwatch.start
msg $chan Stopwatch stopped after $+(%dur,.)
}
}