| # Gaudi Framework, version v21r6 |

Home |  | Generated: 11 Nov 2009

# Sleep.cpp

Go to the documentation of this file.

    00001 #include "GaudiKernel/Sleep.h"
    00002
    00003 #include "boost/thread/xtime.hpp"
    00004 #include "boost/thread/thread.hpp"
    00005
    00006 namespace Gaudi {
    00007
    00010   void Sleep(int sec){
    00011     using namespace boost;
    00012     xtime t;
    00013     if ( xtime_get(&t,TIME_UTC) == TIME_UTC ) {
    00014       t.sec += sec;
    00015       thread::sleep(t);
    00016     }
    00017     // TODO: (MCl) do something if cennot get the time.
    00018   }
    00019
    00022   void NanoSleep(long long nsec){
    00023     using namespace boost;
    00024     xtime t;
    00025     if ( xtime_get(&t,TIME_UTC) == TIME_UTC ) {
    00026       t.sec  += nsec / 1000000000;
    00027       t.nsec += nsec % 1000000000;
    00028       thread::sleep(t);
    00029     }
    00030     // TODO: (MCl) do something if cennot get the time.
    00031   }
    00032
    00033 }