This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <chrono> | |
| #include <ctime> | |
| #include <cmath> | |
| class Timer | |
| { | |
| public: | |
| void start() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Spinlock based on Qt atomic operations. Should be fairly portable. | |
| * To use it, it is recommended to use the SpinLock::Acquire helper | |
| * class to follow RAII patterns, e.g.: | |
| * | |
| * static SpinLock g_myLock; | |
| * // ... | |
| * | |
| * void foo() { | |
| * do_seomething(); |