//CLOCKS_PER_SEC 每秒钟包含的系统时间单位数

cout<<"Enter the delay time,in seconds: ";
        float secs;
        cin >>secs;
        clock_t delay=secs*CLOCKS_PER_SEC;
        cout<<"starting\a\n";
        clock_t start =clock();
        while(clock()-start<delay)
         ;
         cout<<"done \a\n";
        return 0;

相关文章:

  • 2022-12-23
  • 2021-09-25
  • 2021-12-19
  • 2021-11-08
  • 2021-06-28
  • 2021-09-02
  • 2021-10-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2021-12-04
  • 2021-11-29
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案