# シングルショットタイマー # 5秒後に時刻を表示して終了する。 require "al_worker_timer" class Worker1 < AlWorker def initialize2() @timer = Timer.singleshot( 5 ) # 5 sec later. @timer.run() { puts Time.now exit } end end Worker1.new.run