Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
time.hpp
1 /*
2  Title --- time.hpp
3 
4  Copyright (C) 2013 Giacomo Trudu - wicker25[at]gmail[dot]com
5 
6  This file is part of Rpi-hw.
7 
8  Rpi-hw is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation version 3 of the License.
11 
12  Rpi-hw is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with Rpi-hw. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _RPI_HW_TIME_HPP_
23 #define _RPI_HW_TIME_HPP_
24 
25 #include <chrono>
26 #include <unistd.h>
27 
28 // Use some external namespaces
29 using namespace std::chrono;
30 
31 namespace rpihw { // Begin main namespace
32 
33 /*!
34  @namespace rpihw::time
35  @brief Namespace of the time functions.
36 */
37 
38 namespace time { // Begin time namespace
39 
40 //! Waits some seconds
41 void sleep( size_t seconds );
42 
43 //! Waits some milliseconds
44 void msleep( size_t mseconds );
45 
46 //! Waits some microseconds
47 void usleep( size_t useconds );
48 
49 //! Waits some nanoseconds
50 void nsleep( size_t nseconds );
51 
52 } // End of time namespace
53 
54 } // End of main namespace
55 
56 
57 // Include inline functions
58 #include <rpi-hw/time-inl.hpp>
59 
60 #endif /* _RPI_HW_TIME_HPP_ */
void usleep(size_t useconds)
Waits some microseconds.
Definition: time-inl.hpp:44
void nsleep(size_t nseconds)
Waits some nanoseconds.
void msleep(size_t mseconds)
Waits some milliseconds.
Definition: time-inl.hpp:37
void sleep(size_t seconds)
Waits some seconds.
Definition: time-inl.hpp:30