Skip to content

Instantly share code, notes, and snippets.

@Borjis131
Borjis131 / display_current_time.cc
Last active February 24, 2020 08:06
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;
}
}