Sample 5.14:waiting

来源:互联网 发布:2017淘宝卖什么好卖呢 编辑:程序博客网 时间:2024/06/16 21:33
#include<iostream>#include<ctime>int main(){    using namespace std;    cout << "Enter the dealy 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;}

0 0
原创粉丝点击