calculate time works