Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
time-inl.hpp
1 /*
2  Title --- time-inl.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_INL_HPP_
23 #define _RPI_HW_TIME_INL_HPP_
24 
25 namespace rpihw { // Begin main namespace
26 
27 namespace time { // Begin time namespace
28 
29 inline void
30 sleep( size_t seconds ) {
31 
32  // Wait some seconds
33  ::usleep( static_cast< useconds_t >( seconds * 1000000 ) );
34 }
35 
36 inline void
37 msleep( size_t mseconds ) {
38 
39  // Wait some milliseconds
40  ::usleep( static_cast< useconds_t >( mseconds * 1000 ) );
41 }
42 
43 inline void
44 usleep( size_t useconds ) {
45 
46  // Wait some microseconds
47  ::usleep( static_cast< useconds_t >( useconds ) );
48 }
49 
50 } // End of times namespace
51 
52 } // End of main namespace
53 
54 #endif /* _RPI_HW_TIME_INL_HPP_ */
void usleep(size_t useconds)
Waits some microseconds.
Definition: time-inl.hpp:44
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