Opc.Ua.Com.Client.HdaSubscribeAttributeRequest.IncrementSampleTime C# (CSharp) Method

IncrementSampleTime() private method

Increments the sample time to the next interval.
private IncrementSampleTime ( ) : void
return void
        private void IncrementSampleTime()
        {
            // update next sample time.
            long now = DateTime.UtcNow.Ticks;
            long samplingInterval = (long)(m_samplingInterval*TimeSpan.TicksPerMillisecond);

            long nextSampleTime = 0;

            if (nextSampleTime > 0)
            {
                long delta = now - nextSampleTime;

                if (samplingInterval > 0 && delta >= 0)
                {
                    nextSampleTime += ((delta/samplingInterval)+1)*samplingInterval;
                }
            }

            // set sampling time based on current time.
            else
            {
                nextSampleTime = now + samplingInterval;
            }

            m_nextUpdateTime = new DateTime(nextSampleTime);
        }