您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timeSetEvent函数代码示例

51自学网 2021-06-03 08:50:25
  C++
这篇教程C++ timeSetEvent函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中timeSetEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ timeSetEvent函数的具体用法?C++ timeSetEvent怎么用?C++ timeSetEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了timeSetEvent函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: javacall_time_initialize_timer

/** * * Create a native timer to expire in wakeupInSeconds or less seconds. * If a later timer exists, cancel it and create a new timer * * @param wakeupInMilliSecondsFromNow time to wakeup in milli-seconds *                              relative to current time *                              if -1, then ignore the call * @param cyclic <tt>1</tt> indicates that the timer should be repeated cuclically, *               <tt>0</tt> indicates that this is a one-shot timer that should call the callback function once * @param func callback function should be called in platform's context once the timer *			   expires * @param handle A pointer to the returned handle that will be associated with this timer *               On success. * * @return on success returns <tt>JAVACALL_OK</tt>, *         or <tt>JAVACALL_FAIL</tt> or negative value on failure */javacall_result javacall_time_initialize_timer(                    int                      wakeupInMilliSecondsFromNow,                    javacall_bool            cyclic,                    javacall_callback_func   func,                    /*OUT*/ javacall_handle	*handle){    MMRESULT hTimer;    if (!handle || !func) {        return JAVACALL_INVALID_ARGUMENT;    }    hTimer = timeSetEvent(wakeupInMilliSecondsFromNow,            10, /* 10ms: tuned resolution from CLDC_HI porting experiences */            win32_timer_callback,            (DWORD)func,            (JAVACALL_TRUE == cyclic ? TIME_PERIODIC : TIME_ONESHOT));    if (0 == hTimer) {        *handle = NULL;        return JAVACALL_FAIL;    } else {        *handle = (javacall_handle)hTimer;        return JAVACALL_OK;    }}
开发者ID:jiangxilong,项目名称:yari,代码行数:44,


示例2: timeSetEvent

unsigned HostTimerDispatcher::setTimeout(unsigned delay, IDispatch* pDisp){	if (!pDisp) return 0;	unsigned timerID = timeSetEvent(delay, m_accuracy, g_timer_proc, reinterpret_cast<DWORD_PTR>(m_hWnd), TIME_ONESHOT);	addTimerMap(timerID, pDisp);	return timerID;}
开发者ID:19379,项目名称:foo-jscript-panel,代码行数:7,


示例3: DirectSoundInit

Boolean DirectSoundInit( MADDriverRec* WinMADDriver){	OnOff					= false;		WIN95BUFFERSIZE = WinMADDriver->BufSize;	WIN95BUFFERSIZE *= 2L;								// double buffer system		currentBuf 		= calloc( WIN95BUFFERSIZE, 1);		hwnd = GetForegroundWindow();	//GetForegroundWindow();	if( !hwnd) return false;		if(DS_OK == DirectSoundCreate(NULL, &WinMADDriver->lpDirectSound, NULL))	{		if( !AppCreateWritePrimaryBuffer( WinMADDriver->lpDirectSound, &WinMADDriver->lpDirectSoundBuffer, hwnd, WinMADDriver))		{			WinMADDriver->lpDirectSound = 0L;			return false;		}		if( !WinMADDriver->lpDirectSoundBuffer) return false;				// Creation succeeded.		WinMADDriver->lpDirectSound->lpVtbl->SetCooperativeLevel(WinMADDriver->lpDirectSound, hwnd, DSSCL_NORMAL);				WinMADDriver->lpSwSamp = 0L;		if( !LoadSamp(WinMADDriver->lpDirectSound, &WinMADDriver->lpSwSamp, 0L, WIN95BUFFERSIZE, DSBCAPS_LOCSOFTWARE, WinMADDriver))		{			//DEBUG debugger( "Error 2/n");		//DSBCAPS_LOCSOFTWARE			WinMADDriver->lpDirectSound = 0L;			return false;		}				if( !WinMADDriver->lpSwSamp) return false;				WinMADDriver->lpSwSamp->lpVtbl->Play(WinMADDriver->lpSwSamp, 0, 0, DSBPLAY_LOOPING);				///////////				timeBeginPeriod(20);      /* set the minimum resolution */				/*  Set up the callback event.  The callback function		 *  MUST be in a FIXED CODE DLL!!! -> not in Win95		 */		 		// debugger( "timeSetEvent/n");		 		gwID = timeSetEvent(	  40,   												/* how often                 */													  40,   							/* timer resolution          */													  TimeProc,  						/* callback function         */													  (unsigned long) WinMADDriver,		/* info to pass to callback  */													  TIME_PERIODIC); 					/* oneshot or periodic?      */				if( gwID == 0) return false;		else return true;	}		WinMADDriver->lpDirectSound = 0L;		return false;}
开发者ID:mctully,项目名称:tntbasic,代码行数:60,


示例4: win32_rearm_timer

static void win32_rearm_timer(struct qemu_alarm_timer *t){    struct qemu_alarm_win32 *data = t->priv;    assert(alarm_has_dynticks(t));    if (!active_timers[QEMU_CLOCK_REALTIME] &&        !active_timers[QEMU_CLOCK_VIRTUAL] &&        !active_timers[QEMU_CLOCK_HOST])        return;    timeKillEvent(data->timerId);    data->timerId = timeSetEvent(1,                        data->period,                        host_alarm_handler,                        (DWORD)t,                        TIME_ONESHOT | TIME_CALLBACK_FUNCTION);    if (!data->timerId) {        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld/n",                GetLastError());        timeEndPeriod(data->period);        exit(1);    }}
开发者ID:converse2006,项目名称:M2M,代码行数:26,


示例5: PaHost_StartEngine

PaError PaHost_StartEngine( internalPortAudioStream *past ){    PaHostSoundControl *pahsc;    PaError          result = paNoError;    pahsc = (PaHostSoundControl *) past->past_DeviceData;    past->past_StopNow = 0;    past->past_StopSoon = 0;    past->past_IsActive = 1;    /* Create timer that will wake us up so we can fill the DSound buffer. */    {        int msecPerBuffer;        int resolution;        int bufsPerInterrupt = past->past_NumUserBuffers/4;        if( bufsPerInterrupt < 1 ) bufsPerInterrupt = 1;        msecPerBuffer = 1000 * (bufsPerInterrupt * past->past_FramesPerUserBuffer) / (int) past->past_SampleRate;        if( msecPerBuffer < 10 ) msecPerBuffer = 10;        else if( msecPerBuffer > 100 ) msecPerBuffer = 100;        resolution = msecPerBuffer/4;        pahsc->pahsc_TimerID = timeSetEvent( msecPerBuffer, resolution, (LPTIMECALLBACK) Pa_TimerCallback,                                             (DWORD) past, TIME_PERIODIC );    }    if( pahsc->pahsc_TimerID == 0 )    {        past->past_IsActive = 0;        result = paHostError;        sPaHostError = 0;        goto error;    }error:    return result;}
开发者ID:mentat,项目名称:tehDJ,代码行数:31,


示例6: win32_start_timer

static int win32_start_timer(struct qemu_alarm_timer *t){    TIMECAPS tc;    struct qemu_alarm_win32 *data = t->priv;    UINT flags;    memset(&tc, 0, sizeof(tc));    timeGetDevCaps(&tc, sizeof(tc));    data->period = tc.wPeriodMin;    timeBeginPeriod(data->period);    flags = TIME_CALLBACK_FUNCTION;    if (alarm_has_dynticks(t))        flags |= TIME_ONESHOT;    else        flags |= TIME_PERIODIC;    data->timerId = timeSetEvent(1,         // interval (ms)                        data->period,       // resolution                        host_alarm_handler, // function                        (DWORD)t,           // parameter                        flags);    if (!data->timerId) {        fprintf(stderr, "Failed to initialize win32 alarm timer: %ld/n",                GetLastError());        timeEndPeriod(data->period);        return -1;    }    return 0;}
开发者ID:converse2006,项目名称:M2M,代码行数:33,


示例7: a_initTimer

static void a_initTimer(void){#ifdef HAVEMMLIB  TIMECAPS timecaps;  BOOL tok;  timerEvent_g = CreateSemaphore(NULL, 0, 2*HZ, NULL);  tok = (timerEvent_g != NULL);  if (tok)    tok = timeGetDevCaps(&timecaps, sizeof(timecaps)) == TIMERR_NOERROR;  if (tok)    tok = timeBeginPeriod(timecaps.wPeriodMin) == TIMERR_NOERROR;  if (tok)  {    if (timeSetEvent(1000 / HZ, 1000 / HZ,                     (LPTIMECALLBACK) a_timerCallback,                     0, TIME_PERIODIC) == 0)    {      timeEndPeriod(timecaps.wPeriodMin);      tok = FALSE;    }  }  if (!tok && (timerEvent_g != NULL))  {    CloseHandle(timerEvent_g);    timerEvent_g = NULL;  }#endif}
开发者ID:AriZuu,项目名称:picoos,代码行数:34,


示例8: systimer_create

static int systimer_create(systimer_t* id, unsigned int period, int oneshot, systimer_proc callback, void* cbparam){	UINT fuEvent;	timer_context_t* ctx;	if(oneshot && g_ctx.tc.wPeriodMin > period && period > g_ctx.tc.wPeriodMax)		return -EINVAL;	ctx = (timer_context_t*)malloc(sizeof(timer_context_t));	if(!ctx)		return -ENOMEM;	memset(ctx, 0, sizeof(timer_context_t));	ctx->callback = callback;	ctx->cbparam = cbparam;	ctx->period = period;	ctx->count = 0;	// check period value	period = (period > g_ctx.tc.wPeriodMax) ?  TIMER_PERIOD : period;	fuEvent = (oneshot?TIME_ONESHOT:TIME_PERIODIC)|TIME_CALLBACK_FUNCTION;	ctx->timerId = timeSetEvent(period, 10, timer_schd_worker, (DWORD_PTR)ctx, fuEvent);	if(0 == ctx->timerId)	{		free(ctx);		return -EINVAL;	}	*id = (systimer_t)ctx;	return 0;}
开发者ID:xsmart,项目名称:sdk,代码行数:31,


示例9: W95_PlayStart

void W95_PlayStart(MADDriverRec *WinMADDriver){	waveOutSetVolume(0,0xffffffff);		WinMADDriver->WaveOutHdr.lpData= (char*) WinMADDriver->mydata;	WinMADDriver->WaveOutHdr.dwBufferLength = WinMADDriver->WIN95BUFFERSIZE;	WinMADDriver->WaveOutHdr.dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP;	WinMADDriver->WaveOutHdr.dwLoops = 0xffffffff;	WinMADDriver->WaveOutHdr.dwUser = 0;	waveOutPrepareHeader(WinMADDriver->hWaveOut, &WinMADDriver->WaveOutHdr, sizeof(WAVEHDR));	waveOutWrite(WinMADDriver->hWaveOut, &WinMADDriver->WaveOutHdr, sizeof(WAVEHDR));	WinMADDriver->mydma = (char*) WinMADDriver->mydata;		WinMADDriver->MICROBUFState = 0;		timeBeginPeriod(20);	/* set the minimum resolution */		WinMADDriver->gwID = timeSetEvent(40,								/* how often                 */									  40,								/* timer resolution          */									  TimeProc,							/* callback function         */									  (unsigned long)  WinMADDriver,	/* info to pass to callback  */									  TIME_PERIODIC);					/* oneshot or periodic?      */							  							  	//////}
开发者ID:MaddTheSane,项目名称:PlayerPRO,代码行数:26,


示例10: __DjyInitTick

//----初始化tick---------------------------------------------------------------//功能: 初始化定时器,并连接tick中断函数,启动定时器.//参数: 无//返回: 无//备注: 本函数是移植敏感函数.//-----------------------------------------------------------------------------void __DjyInitTick(void){    Int_IsrConnect(cn_int_line_timer_event,__DjyIsrTick);    Int_SettoAsynSignal(cn_int_line_timer_event); //tick中断被设为异步信号    Int_RestoreAsynLine(cn_int_line_timer_event);    timeSetEvent(CN_CFG_TICK_US/mS,CN_CFG_TICK_US/mS,&TimerCallBack,0,TIME_PERIODIC);}
开发者ID:jiankangshiye,项目名称:DJYOS,代码行数:13,


示例11: mm_rearm_timer

static void mm_rearm_timer(struct qemu_alarm_timer *t, int64_t delta){    int64_t nearest_delta_ms = delta / 1000000;    if (nearest_delta_ms < 1) {        nearest_delta_ms = 1;    }    /* UINT_MAX can be 32 bit */    if (nearest_delta_ms > UINT_MAX) {        nearest_delta_ms = UINT_MAX;    }    timeKillEvent(mm_timer);    mm_timer = timeSetEvent((unsigned int) nearest_delta_ms,                            mm_period,                            mm_alarm_handler,                            (DWORD_PTR)t,                            TIME_ONESHOT | TIME_CALLBACK_FUNCTION);    if (!mm_timer) {        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld/n",                GetLastError());        timeEndPeriod(mm_period);        exit(1);    }}
开发者ID:Jeongseob,项目名称:xen-coboost-sched,代码行数:26,


示例12: MytimeSetEvent

HOOKFUNC MMRESULT WINAPI MytimeSetEvent(UINT uDelay, UINT uResolution, LPTIMECALLBACK lpTimeProc, DWORD_PTR dwUser, UINT fuEvent){	if(tasflags.timersMode == 0)	{		debuglog(LCF_TIMERS, __FUNCTION__ " called (and suppressed)./n");		return 11 * ++timerUID;	}	debuglog(LCF_TIMERS, __FUNCTION__ "(%d, %d, 0x%X, 0x%X, 0x%X) called./n", uDelay, uResolution, (DWORD)lpTimeProc, (DWORD)dwUser, fuEvent);	if(tasflags.timersMode == 2)		return timeSetEvent(uDelay, uResolution, lpTimeProc, dwUser, fuEvent);	TimerThreadInfo* threadInfo = new TimerThreadInfo(uDelay, uResolution, fuEvent, lpTimeProc, dwUser, 11 * ++timerUID);	threadInfo->prevTime = detTimer.GetTicks();	threadInfo->prev = ttiTail;	ttiTail->next = threadInfo;	ttiTail = threadInfo;	timerListSize++;	//threadInfo->handle = MyCreateThread(NULL, 0, MyTimerThread, threadInfo, 0, NULL);	//SetThreadPriority(threadInfo->handle, THREAD_PRIORITY_BELOW_NORMAL);	//if(!threadInfo->handle)	//{	//	threadInfo->prev->next = NULL;	//	delete threadInfo;	//	return NULL;	//}	debuglog(LCF_TIMERS, __FUNCTION__ " created TimerThreadInfo with uid 0x%X./n", threadInfo->uid);	return threadInfo->uid;}
开发者ID:Lekila,项目名称:Hourglass-Resurrection,代码行数:27,


示例13: LOG_TRACE

ELTE_VOID CTimer::SetTimer(ELTE_UINT32 tick){	LOG_TRACE();	if(m_uTimerID)	{		timeKillEvent(m_uTimerID);		m_uTimerID = 0;	}	if(0 == tick)	{		//默认200ms发送数据		tick = 200;	}	TIMECAPS   timecaps; 	ELTE_UINT32 TimerAccuracy = Accuracy; 	//从系统获得关于定时器服务能力的信息, 	//分辨率不能超出系统许可值(1到16毫秒) 	if   (timeGetDevCaps(&timecaps,sizeof(TIMECAPS))==TIMERR_NOERROR) 		TimerAccuracy = min(max(timecaps.wPeriodMin,Accuracy),timecaps.wPeriodMax); 	timeBeginPeriod(TimerAccuracy); 	m_uDelayTime = tick;	m_uTimerID = timeSetEvent(m_uDelayTime, TimerAccuracy, TimeProc, (DWORD_PTR)this, TIME_PERIODIC);	LOG_RUN_DEBUG("TimerId is %d.", m_uTimerID);	timeEndPeriod(TimerAccuracy); }
开发者ID:eSDK,项目名称:esdk_elte,代码行数:30,


示例14: mpx_startup_itimer

static intmpx_startup_itimer( void ){	int retval = PAPI_OK;	TIMECAPS tc;	UINT wTimerRes;	/* get the timer resolution capability on this system */	if ( timeGetDevCaps( &tc, sizeof ( TIMECAPS ) ) != TIMERR_NOERROR )		return ( PAPI_ESYS );	wTimerRes = min( max( tc.wPeriodMin, 1 ), tc.wPeriodMax );	timeBeginPeriod( wTimerRes );	/* initialize a periodic timer	   triggering every (milliseconds) 	   and calling (mpx_timer_callback())	   with no data */	mpxTimerID = timeSetEvent( mpx_time, wTimerRes,							   mpx_timer_callback, ( DWORD ) NULL,							   TIME_PERIODIC );	if ( !mpxTimerID )		return PAPI_ESYS;	return ( retval );}
开发者ID:multics69,项目名称:danbi,代码行数:27,


示例15: timing_timeSetEvent

VOID timing_timeSetEvent(UINT delayInSeconds){	// Some vars	UINT uResolution;	TIMECAPS tc;	MMRESULT idEvent;	// We can obtain this minimum value by calling	timeGetDevCaps(&tc, sizeof(TIMECAPS));	uResolution = min(max(tc.wPeriodMin, 0), tc.wPeriodMax);	// Create the timer	idEvent = timeSetEvent(		delayInSeconds,		uResolution,		TimerFunction,		0,		TIME_ONESHOT);	while (!bProcessed){		// wait until uor function finish	}	// destroy the timer	timeKillEvent(idEvent);	// reset the timer	timeEndPeriod(uResolution);}
开发者ID:LordNoteworthy,项目名称:al-khaser,代码行数:30,


示例16: mm_start_timer

static int mm_start_timer(struct qemu_alarm_timer *t){    TIMECAPS tc;    UINT flags;    memset(&tc, 0, sizeof(tc));    timeGetDevCaps(&tc, sizeof(tc));    mm_period = tc.wPeriodMin;    timeBeginPeriod(mm_period);    flags = TIME_CALLBACK_FUNCTION;    if (alarm_has_dynticks(t)) {        flags |= TIME_ONESHOT;    } else {        flags |= TIME_PERIODIC;    }    mm_timer = timeSetEvent(1,                  /* interval (ms) */                            mm_period,          /* resolution */                            mm_alarm_handler,   /* function */                            (DWORD_PTR)t,       /* parameter */                        flags);    if (!mm_timer) {        fprintf(stderr, "Failed to initialize win32 alarm timer: %ld/n",                GetLastError());        timeEndPeriod(mm_period);        return -1;    }    return 0;}
开发者ID:Acidburn0zzz,项目名称:platform_external_qemu,代码行数:33,


示例17: mm_rearm_timer

static void mm_rearm_timer(struct qemu_alarm_timer *t){    int nearest_delta_ms;    assert(alarm_has_dynticks(t));    if (!qemu_clock_has_timers(QEMU_CLOCK_REALTIME) &&        !qemu_clock_has_timers(QEMU_CLOCK_VIRTUAL) &&        !qemu_clock_has_timers(QEMU_CLOCK_HOST)) {        return;    }    timeKillEvent(mm_timer);    nearest_delta_ms = (qemu_next_alarm_deadline() + 999999) / 1000000;    if (nearest_delta_ms < 1) {        nearest_delta_ms = 1;    }    mm_timer = timeSetEvent(nearest_delta_ms,                            mm_period,                            mm_alarm_handler,                            (DWORD_PTR)t,                            TIME_ONESHOT | TIME_CALLBACK_FUNCTION);    if (!mm_timer) {        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld/n",                GetLastError());        timeEndPeriod(mm_period);        exit(1);    }}
开发者ID:Acidburn0zzz,项目名称:platform_external_qemu,代码行数:31,


示例18: KillKeyRepeatCallbackTimer

void CMackieControlMaster::SetKeyRepeatCallbackTimer(float fAlpha, UINT uMax, UINT uMin){	float fMax = (float)uMax;	float fMin = (float)uMin;	m_fKeyRepeatTimeout = ((1.0f - fAlpha) * m_fKeyRepeatTimeout) + (fAlpha);	UINT uElapse = (UINT)(fMax - m_fKeyRepeatTimeout * (fMax - fMin));//	TRACE("CMackieControlMaster::SetKeyRepeatCallbackTimer(): %d/n", uElapse);	// Just in case	KillKeyRepeatCallbackTimer();	// Setup the timer	timeBeginPeriod(m_wKeyRepeatTimerPeriod);	m_uiKeyRepeatTimerID = timeSetEvent(uElapse,										m_wKeyRepeatTimerPeriod,										(LPTIMECALLBACK)_KeyRepeatTimerCallback,										(DWORD)this,										TIME_ONESHOT | TIME_CALLBACK_FUNCTION);	if (!m_uiKeyRepeatTimerID)		TRACE("KeyRepeat timeSetEvent failed!/n");	m_bKeyRepeatTimerActive = true;}
开发者ID:rmunnis,项目名称:Cakewalk-Control-Surface-SDK,代码行数:28,


示例19: create_time_thread

int create_time_thread(lm_res_param_t *pm){    TIMECAPS tc;    pm->tm_param.count = 0;    if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR)    {        DWORD err = GetLastError();        lmice_critical_print("Create time thread failed[%u]/n", err);        return 1;    }    pm->tm_param.wTimerRes = min(max(tc.wPeriodMin, MMTIME_RESOLUTION), tc.wPeriodMax);    pm->tm_param.wTimerDelay = pm->tm_param.wTimerRes;    timeBeginPeriod(pm->tm_param.wTimerRes);    pm->tm_param.wTimerID = timeSetEvent(                pm->tm_param.wTimerDelay,                // delay                pm->tm_param.wTimerRes,                  // resolution (global variable)                time_thread_proc,               // callback function                (DWORD_PTR)pm,                  // user data                TIME_PERIODIC );                // single timer event    if(! pm->tm_param.wTimerID)        return 1;    else        return 0;}
开发者ID:LMiceOrg,项目名称:LMiced,代码行数:30,


示例20: MPF_DECLARE

/** Start scheduler */MPF_DECLARE(apt_bool_t) mpf_scheduler_start(mpf_scheduler_t *scheduler){	mpf_scheduler_resolution_set(scheduler);	scheduler->timer_id = timeSetEvent(					scheduler->resolution, 0, mm_timer_proc, (DWORD_PTR) scheduler, 					TIME_PERIODIC | TIME_CALLBACK_FUNCTION | TIME_KILL_SYNCHRONOUS);	return scheduler->timer_id ? TRUE : FALSE;}
开发者ID:Jared-Prime,项目名称:UniMRCP,代码行数:9,


示例21: HiResSleep

// higer res sleep than standard.int HiResSleep(int msecs){	HANDLE hTempEvent = CreateEvent( 0, true, FALSE, _T("TEMP_EVENT") );	timeSetEvent( msecs, 1, (LPTIMECALLBACK)hTempEvent, 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET );	WaitForSingleObject( hTempEvent, msecs );	CloseHandle( hTempEvent );	return 1;}
开发者ID:Lukepahill,项目名称:Lab-Code,代码行数:9,


示例22: InfoNES_StartTimer

/*===================================================================*/static BOOL InfoNES_StartTimer(){#ifdef WIN32	TIMECAPS caps;	timeGetDevCaps( &caps, sizeof(caps) );	timeBeginPeriod( caps.wPeriodMin );	uTimerID =		timeSetEvent( caps.wPeriodMin * TIMER_PER_LINE, caps.wPeriodMin, TimerFunc, 0, (UINT)TIME_PERIODIC );	// Calculate proper timing	wLinePerTimer = LINE_PER_TIMER * caps.wPeriodMin;#else	struct sigevent sev;	struct itimerspec its;	long long freq_nanosecs = TIMER_PER_LINE*1000000;	/* Create the timer */	LOGV("InfoNES_StartTimer");	if( 0 == uTimerID )	{		sev.sigev_notify = SIGEV_THREAD;		sev.sigev_value.sival_ptr = &uTimerID;		sev.sigev_notify_function = TimerFunc;		sev.sigev_notify_attributes = NULL;		if (timer_create(CLOCK_REALTIME, &sev, &uTimerID) == -1)		{			return 0;		}		/* Start the timer */		its.it_value.tv_sec = freq_nanosecs / 1000000000;		its.it_value.tv_nsec = freq_nanosecs % 1000000000;		its.it_interval.tv_sec = its.it_value.tv_sec;		its.it_interval.tv_nsec = its.it_value.tv_nsec;		if (timer_settime(uTimerID, 0, &its, NULL) == -1)		{			return 0;		}	}	LOGV("InfoNES_StartTimer finished: uTimerID=%d", uTimerID);	// Calculate proper timing	wLinePerTimer = LINE_PER_TIMER;#endif	// Initialize timer variables	wLines = 0;	bWaitFlag = TRUE;	bPauseFlag = FALSE;	// Initialize Critical Section Object	return 1;}
开发者ID:Tonyfield,项目名称:Nester,代码行数:59,


示例23: return

    uintptr_t OSDep::startIntWriteTimer(uint32_t millis, volatile int *addr)    {        return (uintptr_t) timeSetEvent(millis, millis, (LPTIMECALLBACK)intWriteTimerProc, (DWORD_PTR)addr,            TIME_PERIODIC | TIME_CALLBACK_FUNCTION#ifndef UNDER_CE            | kTimeKillSynchronous#endif            );    }
开发者ID:bsdf,项目名称:trx,代码行数:9,


示例24: EnterCriticalSection

void SysTimer::trigger(unsigned long msec){	EnterCriticalSection(&Win32::win32Section);	data->lastDelay = msec;	if (data->timerId != NULL)		timeKillEvent(data->timerId);	data->timerId = timeSetEvent(msec, 5, timerProc, (DWORD_PTR)data, TIME_ONESHOT | TIME_CALLBACK_FUNCTION | TIME_KILL_SYNCHRONOUS);	LeaveCriticalSection(&Win32::win32Section);}
开发者ID:dimdimdimdim,项目名称:geenie-firmware,代码行数:9,


示例25: set_alarm

void set_alarm( long seconds ){#if defined(WIN32)   kill_timer(  );   /* kill old timer */   timer_code = timeSetEvent( seconds * 1000L, 1000, alarm_handler, 0, TIME_PERIODIC );#else   alarm( seconds );#endif}
开发者ID:locke2002,项目名称:ShruggingMan,代码行数:9,


示例26: return

	uintptr OSDep::startIntWriteTimer(uint32 millis, int *addr)	{		return (uintptr) timeSetEvent(millis, millis, (LPTIMECALLBACK)intWriteTimerProc, (DWORD_PTR)addr, 			TIME_PERIODIC | TIME_CALLBACK_FUNCTION#ifndef UNDER_CE			| TIME_KILL_SYNCHRONOUS#endif			);	}
开发者ID:PushButtonLabs,项目名称:PBNetworking,代码行数:9,


示例27: win_timer_init

void win_timer_init(void){        timerId = timeSetEvent(TIME_INTERVAL,10,timerCb,0,TIME_PERIODIC | TIME_CALLBACK_FUNCTION);        TimeEvent = CreateEvent(NULL,FALSE,FALSE,NULL);        late_ticks = 0;        offset_time = GetTickCount();        posix_timer_time=0;}
开发者ID:github188,项目名称:SimpleCode,代码行数:10,


示例28: stop

int timer::start(){    stop();    control.stop = timeSetEvent(control.msecs,						  (control.msecs > 10) ? 5 : 1,						  (LPTIMECALLBACK) timer_fnc,						  (DWORD) &control,						  TIME_ONESHOT | TIME_CALLBACK_FUNCTION);    return 0;};
开发者ID:Eih3,项目名称:v0.83,代码行数:10,


示例29: alarmar

void alarmar(int timeout) {#ifdef __WIN32__    int thid = GetCurrentThreadId();    wintimer = timeSetEvent((timeout * 1000), 10, alarma, thid, TIME_ONESHOT);#else    alarm(0);    signal(SIGALRM, alarma);    alarm(timeout);#endif}
开发者ID:sebasalazar,项目名称:C,代码行数:10,


示例30: _StartTimer

MMRESULT _StartTimer(DWORD dwTime) {    TIMECAPS caps;    MMRESULT timerid;    timeGetDevCaps(&caps, sizeof (caps));    timeBeginPeriod(caps.wPeriodMin);    timerid = timeSetEvent(dwTime, 0, _TimerFunc, 0, (UINT) TIME_PERIODIC);    return timerid;}
开发者ID:JoshShangTsung,项目名称:HB-Shadow,代码行数:10,



注:本文中的timeSetEvent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ time_GetTime函数代码示例
C++ timeKillEvent函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。