Module: AMS::Timer

Defined in:
Documentation/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| ... } ⇒ Fixnum?

Create a timed procedure.

Parameters:

  • time_out (Fixnum)

    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 (Fixnum)

    The number of times the timer was called.

  • time (Fixnum)

    Current time.

Returns:

  • (Fixnum, nil)

    Timer ID if successful.

See Also:

Since:

  • 2.0.0


20
21
# File 'Documentation/ams/timer.rb', line 20

def start(time_out, repeat, &block)
end

.stop(id) ⇒ Boolean

Kill the specified timed procedure.

Parameters:

  • id (Fixnum)

    Timer ID

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


27
28
# File 'Documentation/ams/timer.rb', line 27

def stop(id)
end