time algorithm

time algorithm