implementing: calucrate time