difftime() function in C++
The difftime() function is defined in ctime header file. The difftime() function is used to calculate the difference between two times in second. Syntax:
double difftime(time_t end, time_t start);
Parameters: This method accepts two parameters:
- start: time_t object for start time.
- end: time_t object for end time.
Returns: This function returns the difference between two times in seconds.
Total time required = 2 seconds
Time Complexity: O(n^2) where n is 20000.
Auxiliary Space: O(1)
My Personal Notes arrow_drop_up
Please Login to comment...