Skip to content

Instantly share code, notes, and snippets.

@snaewe
Created February 28, 2013 08:16
Show Gist options
  • Save snaewe/5055121 to your computer and use it in GitHub Desktop.
Save snaewe/5055121 to your computer and use it in GitHub Desktop.
avoid compiler warning "C4244: 'argument' : conversion from '__int64' to 'long"
void sleepMillisec( long milliseconds )
{
boost::this_thread::sleep(
boost::get_system_time() +
boost::posix_time::milliseconds( std::max<long>(milliseconds,0) ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment