Gaudi Framework, version v20r4

Generated: 8 Jan 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 }

Generated at Thu Jan 8 17:44:21 2009 for Gaudi Framework, version v20r4 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004