using time instead of clock for measuring time