Change sleep to use std::time::duration::Duration

This fixes a compile error.
Merge pull request #540 from imbaczek/master

Change sleep to use std::time::duration::Duration