sleep/wakeup refactoring. units of frametime changed to milliseconds