00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 // This file is part of FZIs ic_workspace. 00005 // 00006 // This program is free software licensed under the LGPL 00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3). 00008 // You can find a copy of this license in LICENSE folder in the top 00009 // directory of the source code. 00010 // 00011 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany 00012 // 00013 // -- END LICENSE BLOCK ------------------------------------------------ 00014 00015 //---------------------------------------------------------------------- 00024 //---------------------------------------------------------------------- 00025 #ifndef ICL_CORE_OS_TIME_H_INCLUDED 00026 #define ICL_CORE_OS_TIME_H_INCLUDED 00027 00028 #include "icl_core/os_ns.h" 00029 00030 #if defined _SYSTEM_POSIX_ 00031 # include "icl_core/os_posix_time.h" 00032 #elif defined _SYSTEM_WIN32_ 00033 # include "icl_core/os_win32_time.h" 00034 #else 00035 # error "No os_time implementation defined for this platform." 00036 #endif 00037 00038 namespace icl_core { 00039 namespace os { 00040 00041 inline void gettimeofday(struct timespec *time) 00042 { 00043 ICL_CORE_OS_IMPL_NS::gettimeofday(time); 00044 } 00045 00046 inline int nanosleep(const struct timespec *rqtp, struct timespec *rmtp = 0) 00047 { 00048 return ICL_CORE_OS_IMPL_NS::nanosleep(rqtp, rmtp); 00049 } 00050 00051 inline unsigned int sleep(unsigned int seconds) 00052 { 00053 return ICL_CORE_OS_IMPL_NS::sleep(seconds); 00054 } 00055 00056 inline int usleep(unsigned long useconds) 00057 { 00058 return ICL_CORE_OS_IMPL_NS::usleep(useconds); 00059 } 00060 00061 } 00062 } 00063 00064 #endif