运行一个程序时如何打印出执行程序的时间
生活随笔
收集整理的這篇文章主要介紹了
运行一个程序时如何打印出执行程序的时间
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
#include "stdafx.h"
#include<stdio.h>
#include<string.h>
#include <math.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>//必須加#pragma warning(disable:4996)int main(void)
{int a=1;if (a = 1){printf("11111111111111\n");}else{printf("11111111111111\n");}printf("Time used = %.2f\n", (double)clock() / CLOCKS_PER_SEC);//單位秒getchar();system("pause");return 0;}
總結
以上是生活随笔為你收集整理的运行一个程序时如何打印出执行程序的时间的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言实现:输入一串字符把里面的A、a字
- 下一篇: linux中进程退出函数:exit()和