Skip to content

Instantly share code, notes, and snippets.

@etaf
Created September 18, 2015 10:31
Show Gist options
  • Save etaf/d2938bc2c7ab1fa03742 to your computer and use it in GitHub Desktop.
Save etaf/d2938bc2c7ab1fa03742 to your computer and use it in GitHub Desktop.
clc_elapsed_time.cpp
#include <iostream>
#include <chrono>
#include <thread>
int main()
{
//using namespace std::literals;
std::cout << "Hello waiter" << std::endl;
auto start = std::chrono::high_resolution_clock::now();
std::this_thread::sleep_for (std::chrono::seconds(1));
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> elapsed = end-start;
std::cout << "Waited " << elapsed.count() << " ms\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment