Skip to content

Instantly share code, notes, and snippets.

@kovrov
Created January 5, 2017 04:16
Show Gist options
  • Select an option

  • Save kovrov/18500d582522ab8715be9a3a10ac9398 to your computer and use it in GitHub Desktop.

Select an option

Save kovrov/18500d582522ab8715be9a3a10ac9398 to your computer and use it in GitHub Desktop.
std::chrono
const auto now = std::chrono::steady_clock::now();
const auto ms = std::chrono::time_point_cast<std::chrono::milliseconds>(now);
const float angle = (ms.time_since_epoch().count() % (360 * 20)) / 20.0f;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment