Module: AMS::Timer

Defined in:
docs/ams/timer.rb

Overview

Note:

Windows only!

The Timer namespace contains functions that are associated with Windows timer. Unlike the UI.start_timer/UI.stop_timer functions, AMS::Timer has timeout parameter in milliseconds, it properly stops if repeat is false and the messagebox is called within it, and it yields information to a timer procedure which might be handy.

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.start(time_out, repeat) {|count, time| ... } ⇒ Integer?

Create a timed procedure.

Parameters:

  • time_out (Integer)

    Time out in milliseconds. Minimum elapse is 0x0000000A (10) milliseconds; maximum elapse is 0x7FFFFFFF (2147483647) milliseconds.

  • repeat (Boolean)

    Whether to repeat the timer.

Yield Parameters:

  • count (Integer)

    The number of times the timer was called.

  • time (Integer)

    Current time.

Returns:

  • (Integer, nil)

    Timer ID if successful.

See Also:

Since:

  • 2.0.0

.stop(id) ⇒ Boolean

Kill the specified timed procedure.

Parameters:

  • id (Integer)

    Timer ID

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0