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