Rewrote example to work with windows.
 + Implemented a sleep function that works on linux and windows