OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 19 matching lines...) Expand all Loading... |
30 //! series of increasing values. | 30 //! series of increasing values. |
31 //! | 31 //! |
32 //! \return The value of the system’s monotonic clock, in nanoseconds. | 32 //! \return The value of the system’s monotonic clock, in nanoseconds. |
33 uint64_t ClockMonotonicNanoseconds(); | 33 uint64_t ClockMonotonicNanoseconds(); |
34 | 34 |
35 //! \brief Sleeps for the specified duration. | 35 //! \brief Sleeps for the specified duration. |
36 //! | 36 //! |
37 //! \param[in] nanoseconds The number of nanoseconds to sleep. The actual sleep | 37 //! \param[in] nanoseconds The number of nanoseconds to sleep. The actual sleep |
38 //! may be slightly longer due to latencies and timer resolution. | 38 //! may be slightly longer due to latencies and timer resolution. |
39 //! | 39 //! |
40 //! This function is resilient against the underlying `nanosleep()` system call | 40 //! On POSIX, this function is resilient against the underlying `nanosleep()` |
41 //! being interrupted by a signal. | 41 //! system call being interrupted by a signal. On Windows, the global system |
| 42 //! timer resolution is not modified with `timeBeginPeriod()`, so the time |
| 43 //! slept will have a resolution of approximately 16ms by default. |
42 void SleepNanoseconds(uint64_t nanoseconds); | 44 void SleepNanoseconds(uint64_t nanoseconds); |
43 | 45 |
44 } // namespace crashpad | 46 } // namespace crashpad |
45 | 47 |
46 #endif // CRASHPAD_UTIL_MISC_CLOCK_H_ | 48 #endif // CRASHPAD_UTIL_MISC_CLOCK_H_ |
OLD | NEW |