C#交流俱乐部

学习为主,互相帮助

博客园 首页 新随笔 联系 订阅 管理

//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;

posted on 2012-12-28 16:43  bluce chen  阅读(976)  评论(0编辑  收藏  举报