如何用C 中time函数
#include #include int main(int argc, char *args[]){ time_t start = 0; time_t end = 0; printf("Please press Enter to begin。
"); getchar(); printf("Begin。。。。
"); start = time(0); printf("If you want to stop, please press Enter。
"); getchar(); end = time(0); printf...全部
#include #include int main(int argc, char *args[]){ time_t start = 0; time_t end = 0; printf("Please press Enter to begin。
"); getchar(); printf("Begin。。。。
"); start = time(0); printf("If you want to stop, please press Enter。
"); getchar(); end = time(0); printf("Total time is %d S。
", end - start); return 0;}PS: time() returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds。收起