introduce starttime and endtime