Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ show time elapsed

//***C++11 Style:***
#include <chrono>

std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();

std::cout << "Time difference = " << std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count() << "[µs]" << std::endl;
std::cout << "Time difference = " << std::chrono::duration_cast<std::chrono::nanoseconds> (end - begin).count() << "[ns]" << std::endl;
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ code to print hello world 
Cpp :: c++ addition 
Cpp :: sfml mouse position 
Cpp :: if vector contains value c++ 
Cpp :: c++ inline 
Cpp :: select one random element of a vector in c++ 
Cpp :: flutter convert datetime in day of month 
Cpp :: c++ how to loop through a vector but not the last element 
Cpp :: string hex to int c++ 
Cpp :: vhdl integer to std_logic_vector 
Cpp :: c++ pause program 
Cpp :: for vector c++ 
Cpp :: c++ bold text 
Cpp :: c++ fill array with 0 
Cpp :: how to make string get spaces c++ 
Cpp :: print array c++ 
Cpp :: inreament operator 
Cpp :: set platformio to C++14 
Cpp :: c++ make constructor fails if bad argument 
Cpp :: input pdf latex 
Cpp :: set precision in c++ 
Cpp :: reverse an array using pointers in c++ 
Cpp :: initialize all elements of vector to 0 c++ 
Cpp :: c++ random number generator uniform distribution 
Cpp :: c++ virtual function in constructor 
Cpp :: comment in c++ 
Cpp :: c++ area of triangle 
Cpp :: c++ matrix as argument 
Cpp :: c++ memory leak 
Cpp :: remove last character from string c++ 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =