Measuring CPU time in c++
问题 If I had the following code clock_t t; t = clock(); //algorithm t = clock() - t; t would equal the number of ticks to run the program. Is this the same is CPU time? Are there any other ways to measure CPU time in C++? OS -- Debian GNU/Linux I am open to anything that will work. I am wanting to compare the CPU time of two algorithms. 回答1: clock() is specified to measure CPU time however not all implementations do this. In particular Microsoft's implementation in VS does not count additional