コード例 #1
0
 /// <summary>
 /// The extent since the submitted time or the current time if not set.
 /// </summary>
 /// <param name="now">The optional time to calculate the extent from.</param>
 /// <returns>The timespan.</returns>
 private TimeSpan ExtentNow(int?now = null)
 {
     return(ConversionHelper.DeltaAsTimeSpan(Start, now ?? Environment.TickCount).Value);
 }
コード例 #2
0
 protected override void StatisticsRecalculate(S stats)
 {
     stats.Name         = Key.Header.ToKey();
     stats.LastAccessed = mLastAccessed.HasValue ? ConversionHelper.DeltaAsFriendlyTime(mLastAccessed.Value, Environment.TickCount):"Not accessed";
 }
        /// <summary>
        /// Identifies whether the context is overdue for a poll.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="timeStamp">The compare timestamp. If this is null then Environment.TickCount is used instead.</param>
        /// <returns></returns>
        public override bool PastDueCalculate(IClientPriorityHolderMetrics context, int?timeStamp = null)
        {
            var timePassed = ConversionHelper.DeltaAsTimeSpan(context.LastPollTickCount, timeStamp ?? Environment.TickCount);

            return(timePassed.HasValue && timePassed.Value > context.MaxAllowedPollWait);
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransmissionPayloadTraceEventArgs"/> class.
 /// </summary>
 /// <param name="start">The tickcount start.</param>
 /// <param name="message">The message.</param>
 /// <param name="source">The optional source parameter.</param>
 public TransmissionPayloadTraceEventArgs(int start, string message = null, string source = null)
 {
     Extent  = ConversionHelper.CalculateDelta(Environment.TickCount, start);
     Source  = source;
     Message = message;
 }