private void IncrementSampleTime()
{
// update next sample time.
long now = DateTime.UtcNow.Ticks;
long samplingInterval = (long)(m_samplingInterval*TimeSpan.TicksPerMillisecond);
if (m_nextSamplingTime > 0)
{
long delta = now - m_nextSamplingTime;
if (samplingInterval > 0 && delta >= 0)
{
m_nextSamplingTime += ((delta/samplingInterval)+1)*samplingInterval;
}
}
// set sampling time based on current time.
else
{
m_nextSamplingTime = now + samplingInterval;
}
}