Skip to content

Instantly share code, notes, and snippets.

@yorung
Last active August 29, 2015 14:22
Show Gist options
  • Save yorung/7f70c248f103ae2508b8 to your computer and use it in GitHub Desktop.
Save yorung/7f70c248f103ae2508b8 to your computer and use it in GitHub Desktop.
GetTime using C++11
#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