示例#1
0
        /// <summary>
        /// Retrieve the current tick count.
        /// </summary>
        /// <param name="tick">Out param represents the current tick count.</param>
        /// <remarks>The tick count is a 64 bit integer, it's big enough not
        /// to worry about loop over.</remarks>

        public static void GetPreciseTickCount(out long tick)
        {
            if (!QueryPerformanceCounter(out tick))
            {
                tick = 0;
                string msg = string.Format("PreciseTickCount::GetPreciseTickCount(): Error in calling QueryPerformanceCounter");
                WindowsEventLog.AddEvent(msg, WindowsEventLog.TickCountError);
            }
        }
示例#2
0
        /// <summary>
        /// Static constructor. It initializes the static sFrequency data member.
        /// </summary>

        static PreciseTickCount()
        {
            // initialize the static sFrequency
            if (!QueryPerformanceFrequency(out s_Frequency))
            {
                string msg = string.Format("PreciseTickCount::PreciseTickCount(): Error in calling QueryPerformanceFrequency");
                WindowsEventLog.AddEvent(msg, WindowsEventLog.TickCountError);
            }
        }