/*
* Demonstrate how to set up a timer that, on expiry,
* sends us a pulse. This example sets the first
* expiry to 1.5 seconds and the repetition interval
* to 1.5 seconds.
*/
#include <stdio.h>
#include <time.h>
#include <sys/netmgr.h>
#include <sys/neutrino.h>
#include <unistd.h>
#define MY_PULSE_CODE _PULSE_CODE_MINAVAIL
#define BILLION 1000000000L;
typedef union {
struct _pulse pulse;
/* your other message structures would go
here too */
} my_message_t;
void do_every_timer_1(int i)
{
printf("i am one\n");
}
void do_every_timer_5(int i)
{
struct timespec start, stop;
double accum;
printf("i am five\n");
return;
if( clock_gettime( CLOCK_REALTIME, &start) == -1 ) {
perror( "clock gettime" );
return;
}
//do work
/*if(i == 3){
sleep(3);
}*/
if( clock_gettime( CLOCK_REALTIM
QNX中定时器用法demo
最新推荐文章于 2022-10-31 18:26:56 发布