measuring time spent in game loop