public ibsTicker(int para_tickerTime, ThreadPriority threadPrio) { if (ibsTicker._instanceCounter == 0) { ++ibsTicker._instanceCounter; this._locInstNumber = ibsTicker._instanceCounter; ibsTicker.timeProcPeriodic = new ibsTicker.TimeProc(ibsTicker.OnTimerPeriodicEvent); ibsTicker.timerID = ibsTicker.timeSetEvent(5, 0, ibsTicker.timeProcPeriodic, 0, 1); } else { ++ibsTicker._instanceCounter; this._locInstNumber = ibsTicker._instanceCounter; } this._tickerState = IBSTickerMode.Idle; this._tickerTime = para_tickerTime; if (this._tickerTime < 5) { this._tickerTime = 5; } this._thrHdlCallBack = new Thread(new ThreadStart(this.workerThreadCallback)); this._thrHdlCallBack.Start(); this._thrHdlCallBack.Priority = threadPrio; }
private static extern int timeSetEvent(int delay, int resolution, ibsTicker.TimeProc timeProc, int user, int mode);