Simple class to calculate time intervals