コード例 #1
0
        public void Start()
        {
            TimerCaps myTimerCaps = new TimerCaps();

            QueryTimerResolution(ref myTimerCaps);
            SetTimerResolution(5000);
            QueryTimerResolution(ref myTimerCaps);
        }
コード例 #2
0
        public void QueryTimerResolution(ref TimerCaps myTimerCaps)
        {
            uint PeriodMin, PeriodMax, PeriodCurrent;
            var  result = NtQueryTimerResolution(out PeriodMax, out PeriodMin, out PeriodCurrent);

            myTimerCaps.PeriodMax     = PeriodMax / 10000F;
            myTimerCaps.PeriodMin     = PeriodMin / 10000F;
            myTimerCaps.PeriodCurrent = PeriodCurrent / 10000F;
            if (result == 0)
            {
                myTimerCaps.HasBeenRun = true;
            }
        }