Calculate time of task in template