vc6.0编译器中可以查看一个程序运行所占的内存和时间吗?
希望大家能给个vc6.0的详细使用教程比如都可以实现什么功能(有没有那种比运行调试编译更详细例如题目那样的其他的功能)
//时间函数 #include<stdio.h> #include<time.h> #include<stdlib.h> #define N 10 int cmp(const void *a,const void *b) { int *pa = (int*)a,*pb = (int *)b; return *pa-*pb; } int main() { int i; time_t tim; struct tm *at; char now[80]; time(&tim); at = localtime(&tim); printf("local time is.\n"); strftime(now,79,"%Y-%m-%d\n%H:%M:%S\n",at); puts(now); //打印当前时间 printf("\n"); clock_t start,finish; start = clock(); double process; int sum[N]={10,9,8,7,6,5,4,3,2,1}; printf("original sort.\n"); for(i=0;i<N;i++)printf("%d ",sum[i]); printf("\n\n"); qsort(sum,N,sizeof(int),cmp); printf("after qsort.\n"); for(i=0;i<N;i++)printf("%d ",sum[i]); printf("\n\n"); finish = clock(); process = finish - start; //快速排序和时间统计. printf("time you spend is %lf sec.\n\n",process/CLOCKS_PER_SEC); time_t timep; //打印时间的第二第三种方式 time(&timep); printf("local time is : %s\n",asctime(gmtime(&timep))); printf("local time is : %s\n",ctime(&timep)); return 0; }
#include<stdio.h> #include<stdlib.h> #include<time.h> #define N 10 int cmp(const void *a,const void *b) { int *pa = (int*)a,*pb = (int *)b; return *pa-*pb; } int main() { int i; clock_t start,finish; double process; int sum[N]={10,9,8,7,6,5,4,3,2,1}; start = clock(); printf("original sort.\n"); for(i=0;i<N;i++)printf("%d ",sum[i]); printf("\n\n"); qsort(sum,N,sizeof(int),cmp); printf("after qsort.\n"); for(i=0;i<N;i++)printf("%d ",sum[i]); printf("\n\n"); finish = clock(); process = (double)(finish - start); //快速排序和时间统计. printf("time you spend is %lf sec.\n\n",process/CLOCKS_PER_SEC); return 0; }