inlib  1.2.0
/Users/barrand/private/dev/softinex/old/inexlib-1.2/inlib/inlib/sys/sleep
Go to the documentation of this file.
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
00002 // See the file inlib.license for terms.
00003 
00004 #ifndef inlib_sys_sleep
00005 #define inlib_sys_sleep
00006 
00007 #ifdef WIN32
00008 #include <windows.h>
00009 #else
00010 #include <unistd.h>
00011 #endif
00012 
00013 namespace inlib {
00014 
00015 inline void sleep_secs(unsigned int a_secs){
00016 #ifdef WIN32
00017   ::Sleep(a_secs*1000);
00018 #else
00019   ::sleep(a_secs);
00020 #endif
00021 }
00022 
00023 inline void sleep_milli_secs(unsigned int a_milli_sec){
00024 #ifdef WIN32
00025   ::Sleep(a_milli_sec);
00026 #else
00027   ::usleep(a_milli_sec*1000); //it is in micro seconds.
00028 #endif
00029 }
00030 
00031 }
00032 
00033 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines