time calculation script