コード例 #1
0
 public static void LapStop()
 {
     if (!_running)
     {
         StopWatchException.NotStartedException();
     }
     _laps++;
     _lapTimes.Add(DateTime.Now);
 }
コード例 #2
0
 public static void Stop()
 {
     if (!_running)
     {
         StopWatchException.NotStartedException();
     }
     _stop    = DateTime.Now;
     _running = false;
 }
コード例 #3
0
 public static TimeSpan GetDuration()
 {
     if (_running)
     {
         StopWatchException.NotStoppedExeption();
     }
     if (_start == _stop)
     {
         StopWatchException.NotStartedException();
     }
     return(_stop - _start);
 }