示例#1
0
        /// <summary>
        /// Normalizes this instance.	
        /// </summary>
        /// <remarks></remarks>
      public void Normalize()
      {
         int millisecs = this.Millis;
         if (millisecs % 1000 == 0)
         {
            unit = TimeUnits.SECONDS;
            timeout = millisecs / 1000;

            if (timeout % 60 == 0)
            {
               unit = TimeUnits.MINUTES;
               timeout /= 60;

               if (timeout % 60 == 0)
               {
                  unit = TimeUnits.HOURS;
                  timeout /= 60;
               }
            }
         }
      }
示例#2
0
 public Timeout(int period, TimeUnits unit)
 {
     this.timeout = period;
     if (unit != null) this.unit = unit;
 }