Commit a16b841b by SongXinkai

20181016

parent 6606795d
No preview for this file type
...@@ -9,10 +9,18 @@ int main(){ ...@@ -9,10 +9,18 @@ int main(){
if (a == 0){ if (a == 0){
cout << "xx" << endl; cout << "xx" << endl;
} }
time(&a); time(&a); // time.h
sleep(4); sleep(4); // unistd.h
time(&b); time(&b);
cout << a << ", " << b << endl; cout << a << ", " << b << endl;
cout << b -a << endl; cout << b -a << endl;
clock_t clc_a = 0, clc_b = 0;
clc_a=clock(); // time.h
sleep(4); // unistd.h
clc_b=clock();
cout << clc_a << ", " << clc_b <<", CLOCKS_PER_SEC: " << CLOCKS_PER_SEC<< endl;
cout << (clc_b - clc_a) / CLOCKS_PER_SEC << endl;
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment