Skip to content

Instantly share code, notes, and snippets.

@Borjis131
Last active February 24, 2020 08:06
Show Gist options
  • Save Borjis131/ceac3049211b76b552cea7857da03227 to your computer and use it in GitHub Desktop.
Save Borjis131/ceac3049211b76b552cea7857da03227 to your computer and use it in GitHub Desktop.
Displays current time since high_resolution_clock epoch in microseconds
#include <iostream>
#include <chrono>
int main(){
std::chrono::high_resolution_clock clock;
while (1){
uint64_t current_ms = std::chrono::duration_cast<std::chrono::microseconds>(clock.now().time_since_epoch()).count();
std::cout << "\r" << current_ms << std::flush;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment