#include <stdio.h>
#include <time.h>
#include <windows.h>
void Task()
{
printf("Hi");
}
int main ( ) {
time_t t;
clock_t start, end;
long i;
long count;
double x = 0.0;
count = 2;
start = clock();
time(&t);
printf(ctime(&t));
printf( "Counting to %ld\n", count );
if(count)
{
Task();
}
end = clock();
printf( "That took %f seconds and I counted up to %ld", (((double)(end-start)/CLOCKS_PER_SEC)), count );
printf( "\nThat also took %d clock tics\n ", clock());
return 0;
}
我想获取执行任务函数的开始时间和结束时间。我正在尝试为任务功能创建中断,但在程序中显示“嗨”。我在这方面并不成功。所以请任何人都可以指导我这件事。
最佳答案
尝试从 Multimedia Timers 开始。另一种可能的方法可能是使用 CreateTimerQueueTimer()
and friends .
关于c - Windows操作系统的C语言软件中断服务例程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19771253/