Add func start end time

I think it would be easier to have a function for that