Fix unreliable timeouts

These commits should fix unreliable timeouts and window updates

I also changed the timer resoultion to seconds instead of milliseconds. It is not important whether a notification is shown for 9.5 or 10.5 seconds.