0

Is there a C++ equivalent of Python's time.process_time()?

I am wanting to print the current processing time of the algorithm I am creating.

while (steps < 100){
    //...
    std::cout << "Current processing time: " << process_time() << std::endl;
    //...
{

Output:

Current processing time: 10.431
Current processing time: 13.424
Wizard
  • 1,533
  • 4
  • 19
  • 32
  • 1
    Have a look into [std::chrono](http://en.cppreference.com/w/cpp/chrono). Not exactly the same as `process_time()` but you can easily find out time taken for running the algorithm using this. – Vishaal Shankar Jun 01 '18 at 09:58
  • On Windows you can use GetProcessTimes to determine the time your process used the CPU (User + kernel times are provided separately). – Guido Niewerth Jun 01 '18 at 11:45

0 Answers0