#include #include /*********************************************************** Timer Interrupt Process Definitions ************************************************************/ #pragma comment(lib,"winmm") #define TIMER_UDELAY 1 // 1[msec] #define TIMER_RESOLUTION 0 // 割り込み精度(最高精度) #define TIMER_ITERATION 60000 // 繰り返し回数 void CALLBACK timerProc(UINT,UINT,DWORD_PTR,DWORD_PTR,DWORD_PTR); /*********************************************************** Thread Process Definitions ************************************************************/ #include void threadProc(void *); /*********************************************************** Main Function ************************************************************/ int main(void) { char str[256]; _beginthread(threadProc,0,0); _beginthread(threadProc,0,0); printf("何かを入力\n"); scanf("%s",str); return 0; } /*********************************************************** Thread Process ************************************************************/ void threadProc(void *arglist) { int ti=0; puts("タイマ割り込み開始\n"); MMRESULT timerID = timeSetEvent( TIMER_UDELAY, // 割り込み間隔 TIMER_RESOLUTION, // 割り込み精度 timerProc, // タイマ割り込み処理 (DWORD_PTR)&ti, // タイマ割り込み処理への引数(dwUser) TIME_PERIODIC | TIME_CALLBACK_FUNCTION // 繰り返し,割り込み処理 ); if ( !timerID ) { puts("タイマ割り込み失敗\n"); return; } while(ti