Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 323 Bytes

File metadata and controls

12 lines (11 loc) · 323 Bytes

Cpp Snippets

Time code

#include <chrono>
#include <iostream>
auto start = std::chrono::high_resolution_clock::now();
// Code to be timed
auto finish = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = finish - start;
std::cout << "Code ran for " << elapsed.count() << "s\n";