Windows操作系统中C的软件中断服务例程 [英] software Interrupt Service routine in C for windows operating system

查看:412
本文介绍了Windows操作系统中C的软件中断服务例程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#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;
} 

我想获取执行Task函数所需的开始时间和结束时间.我正在尝试为Task函数创建中断,但在程序中显示Hi.我没有成功.因此,您能不能请任何人就此指导我.

I want to get the start time and end time taken to execute the Task function. I am trying to create interrupt for the Task function but displaying Hi in the program. I am not successful with that. So could you please anyone can guide me regarding this.

推荐答案

尝试从 CreateTimerQueueTimer()和朋友.

Try starting with the Multimedia Timers. Another possible approach might be using CreateTimerQueueTimer() and friends.

这篇关于Windows操作系统中C的软件中断服务例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆