Project

General

Profile

Actions

Timer » History » Revision 1

Revision 1/17 | Next »
Per Amundsen, 02/15/2014 04:17 AM


Added in 1.9.0

/timers [off]
/timer[n|name] [off]
/timer[n|name] [-cdehimopr] [time] <repetitions> <interval> <code>

Switches

-c - TODO
-d - TODO
-e - Executes the code associated with a timer.
-h - Creates a high-resolution timer.
-i - Dynamically associates itself with the active connection.
-m - Treats the interval parameter as milliseconds instead of seconds.
-o - Creates a offline timer.
-p - Pauses a timer.
-r - Resumes a timer.

Parameters

[off] - Turns of a timer.
[n|name] - The name or index of the timer.
[time] - TODO
<repetitions> - The amount of timer the timers should repeat itself. An repetition value of '0' will repeat for ever.
<interval> - The delay between two consecutive timer executions
<code> - Code to be executed.

Example

alias example {
  ;Create a variable and set value to 5.
  /var %reps = 5

  ;Call the timer %reps times after 1 second delay each.
  /.timer %reps 1 count-down

  ;Print the first count.
  count-down
}
alias -l count-down {
  echo -a Count: $timer($ltimer).reps
}

Updated by Per Amundsen about 10 years ago · 1 revisions

Also available in: PDF HTML TXT