OSVR-Core
Microsleep.h
Go to the documentation of this file.
1 
12 // Copyright 2015 Sensics, Inc.
13 //
14 // Licensed under the Apache License, Version 2.0 (the "License");
15 // you may not use this file except in compliance with the License.
16 // You may obtain a copy of the License at
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 // See the License for the specific language governing permissions and
24 // limitations under the License.
25 
26 #ifndef INCLUDED_Microsleep_h_GUID_18728CEA_A634_4268_845E_86007CA19511
27 #define INCLUDED_Microsleep_h_GUID_18728CEA_A634_4268_845E_86007CA19511
28 
29 // Internal Includes
30 #include <osvr/Util/ReturnCodesC.h>
31 #include <osvr/Util/Export.h>
32 
33 // Library/third-party includes
34 #include <boost/thread/thread.hpp>
35 
36 // Standard includes
37 // - none
38 
39 namespace osvr {
40 
41 namespace util {
42 
43  namespace time {
44 
56  inline OSVR_ReturnCode microsleep(OSVR_IN uint64_t microseconds) {
57  boost::this_thread::sleep(
58  boost::posix_time::microseconds(microseconds));
59  return OSVR_RETURN_SUCCESS;
60  }
61 
62  } // end namespace time
63 
64 } // end namespace util
65 
66 } // end namespace osvr
67 
68 #endif // INCLUDED_Microsleep_h_GUID_18728CEA_A634_4268_845E_86007CA19511
Definition: RunLoopManager.h:42
OSVR_ReturnCode microsleep(OSVR_IN uint64_t microseconds)
Request a thread sleep for at least the given number of microseconds.
Definition: Microsleep.h:56
Header declaring a type and values for simple C return codes.
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
Definition: ReturnCodesC.h:45
#define OSVR_IN
Indicates a required function parameter that serves only as input.
Definition: AnnotationMacrosC.h:100