📜  c++ 执行时间 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:47.605000             🧑  作者: Mango

代码示例1
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 \n"; 
}