C/C++ clock()

 

{

  clock_t start = clock();

  for(int i = 0; i < 1000000; i++)

  {

    static int var = 0;

    was ++;

  }

  clock_t end = clock();

}

// return time used by the processor clock. In order to obtain the number of seconds used by the CPU, you need to divide CLOCKS_PER_SEC.

Guess you like

Origin www.cnblogs.com/YZFHKMS-X/p/11876819.html