building time up function