Search
 
SCRIPT & CODE EXAMPLE
 

CPP

time measurement c++

//***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 :: filling dynamic array with a specific value in c++ 
Cpp :: pyramid shape in c++ 
Cpp :: gestd::getline with wstring 
Cpp :: how to make a sqlite3 object in cpp 
Cpp :: fast input and output c++ 
Cpp :: ostream was not declared in this scope 
Cpp :: delete 2d dynamic array c++ 
Cpp :: how to define an unsigned signal in VHDL 
Cpp :: stl for sorting in c++ 
Cpp :: reverse an array using pointers in c++ 
Cpp :: distinct colors cses solution 
Cpp :: pass c++ 
Cpp :: length of 2d array c++ 
Cpp :: print vector 
Cpp :: arduino led code 
Cpp :: stack implementation using linked list in cpp 
Cpp :: how to read a line from the console in c++ 
Cpp :: spicoli 
Cpp :: what is _asm in C++ 
Cpp :: c++ initialize array with all zeros 
Cpp :: how to make for loop in c++ 
Cpp :: c++ array loop 
Cpp :: round double to n decimal places c++ 
Cpp :: c++ program to find prime number using function 
Cpp :: sort stl 
Cpp :: copy a part of a vector in another in c++ 
Cpp :: number of words in c++ files 
Cpp :: c++ fizzbuzz 
Cpp :: round up 2 digits float c++ 
Cpp :: setprecision c++ 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =