adjusted get_time func