Last active
August 29, 2015 14:22
-
-
Save yorung/7f70c248f103ae2508b8 to your computer and use it in GitHub Desktop.
GetTime using C++11
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 <chrono> | |
| double GetTime() | |
| { | |
| static auto start = std::chrono::high_resolution_clock::now(); | |
| auto now = std::chrono::high_resolution_clock::now(); | |
| return std::chrono::duration_cast<std::chrono::duration<double, std::ratio<1, 1>>>(now - start).count(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment