#include <ctime> #include <iostream> using namespace std; int main(void) { long i = 100000000L; clock_t start, finish; start = clock(); while (i--) { /* do something */ } finish = clock(); cout << "time:" << (double)(finish - start) / CLOCKS_PER_SEC; system("pause"); }
时间: 2024-10-06 03:59:48