Compare times from now and 10 seconds in the future. : Compare Time « Time « Ruby






Compare times from now and 10 seconds in the future.


require 'date'
before_time = Time.now
before_datetime = DateTime.now
sleep(10)
Time.now - before_time                
DateTime.now - before_datetime        

 








Related examples in the same category

1.Compare time local