Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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 
"; 
}

 
PREVIOUS NEXT
Tagged: #execution #time
ADD COMMENT
Topic
Name
9+2 =