add time function.