calculate time of tasks in template