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 :: conda list envs 
Cpp :: add c++ 
Cpp :: move mouse c++ 
Cpp :: c++ - include all libraries 
Cpp :: c++ primality test 
Cpp :: cpp get data type 
Cpp :: How to make two dimensional string in c++ 
Cpp :: c++ typedef array 
Cpp :: qt change window title 
Cpp :: how to print items in arduino 
Cpp :: c++ usleep() 
Cpp :: rng c++ 
Cpp :: c++ colour text 
Cpp :: fatal error: opencv2/opencv.hpp: No such file or directory 
Cpp :: c++ pause 
Cpp :: how to get a random number between two numbers in c++ 
Cpp :: rapidjson write stringbuffer to file 
Cpp :: basic symbol meanings in c++ 
Cpp :: c++ save typeid 
Cpp :: iomanip 
Cpp :: c++ wait for user input 
Cpp :: fibonacci in c++ 
Cpp :: pass c++ 
Cpp :: prime number program in c 
Cpp :: convert vector into array c++ 
Cpp :: how to get double y dividing 2 integers in c++ 
Cpp :: string count occurrences c++ 
Cpp :: how to declare 1-D array in C/C++ 
Cpp :: check if an element is in a map c++ 
Cpp :: c++ merge sort 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =