time interval code