diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-01 10:59:19 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-02 23:19:38 +0200 |
| commit | aaa3a04577a7d4633ef0eb9eb7dc2aa33db0d0eb (patch) | |
| tree | d83709d246b390c7279720105f2269fb2b373259 /compat/timer-resolution.hpp | |
| parent | 81d11949122c63feb14e6595fc59e49cd264c89e (diff) | |
compat/timer-resolution: use undocumented windows API
Unlike timeBeginPeriod in winmm, this one sets the timer
resolution for the calling process, only.
Diffstat (limited to 'compat/timer-resolution.hpp')
| -rw-r--r-- | compat/timer-resolution.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compat/timer-resolution.hpp b/compat/timer-resolution.hpp new file mode 100644 index 00000000..5db877c0 --- /dev/null +++ b/compat/timer-resolution.hpp @@ -0,0 +1,19 @@ +#pragma once + +#if defined _WIN32 +# include "export.hpp" + +class OTR_COMPAT_EXPORT timer_resolution final +{ + unsigned long old_value; + +public: + timer_resolution(int msecs); + ~timer_resolution(); +}; +#else +struct timer_resolution final +{ + inline timer_resolution(int) {} +}; +#endif |
