Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ execution time

int main() 
{
  time_t start, end;
  time(&start); // start time
  // {your code goes here}
  time(&end);  // end time 
  double time_taken = double(end - start); // calulate diffrence
  std::cout << " duration: " << time_taken << " s 
"; 
}

Comment

c++ execution time

#include <chrono>
using namespace std::chrono;
 
auto start = high_resolution_clock::now();
// code
auto stop = high_resolution_clock::now();
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ files 
Cpp :: how to create a copy constructor for generic array class in c++ 
Cpp :: how to interface c++ in haxe 
Cpp :: c++ while loop decrement 
Cpp :: cuda kernel extern shared memory 
Cpp :: non stoichiometric nacl is yellow 
Cpp :: cout hex value 
Cpp :: climits in cpp 
Cpp :: how to use comparator funtion in priority queue in c++ 
Cpp :: c++ find index of an element 
Cpp :: convert whole string to uppercase c++ 
Cpp :: scale window sdl2 
Cpp :: landscape overleaf 
Cpp :: C++ shortcuts in desktopp app 
Cpp :: recursive binary search 
Cpp :: c++ print byte as bit 
Cpp :: c++ string to integer without stoi 
Cpp :: Sort array using inbuilt sort function in decreasing order 
Cpp :: c++ show current time 
Cpp :: lopping over an array c++ 
Cpp :: in c++ ++ how to write if without if 
Cpp :: c++ evaluate expression 
Cpp :: count occurrences of character in string c++ 
Cpp :: c++ iterate over vector 
Cpp :: sort vector in descending order 
Cpp :: c++ construnctor 
Cpp :: Heap pinter c++ 
Cpp :: how to clear vector c++ 
Cpp :: cpp float to string 
Cpp :: c++ foreach 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =