# File lib/system_timer.rb, line 48
48:     def timeout_after(seconds, exception_class = nil)
49:       new_timer = nil                                      # just for scope
50:       @monitor.synchronize do
51:         new_timer = timer_pool.add_timer seconds, exception_class
52:         timer_interval = timer_pool.next_trigger_interval_in_seconds
53:         debug "==== Install Timer ==== at #{Time.now.to_f}, next interval: #{timer_interval}"
54:         if timer_pool.first_timer?
55:           install_first_timer_and_save_original_configuration timer_interval
56:         else
57:           install_next_timer timer_interval
58:         end
59:      end
60:       return yield
61:     ensure
62:       @monitor.synchronize do
63:         debug "==== Cleanup Timer ==== at #{Time.now.to_f}, #{new_timer} "
64:         timer_pool.cancel new_timer
65:         timer_pool.log_registered_timers if debug_enabled?
66:         next_interval = timer_pool.next_trigger_interval_in_seconds
67:         debug "Cleanup Timer : next interval #{next_interval.inspect} "
68:         if next_interval
69:           install_next_timer next_interval
70:         else
71:           restore_original_configuration          
72:         end
73:       end
74:     end