Coverage Report - org.jbehave.core.steps.Timer
 
Classes in this File Line Coverage Branch Coverage Complexity
Timer
83%
5/6
50%
1/2
2
 
 1  
 package org.jbehave.core.steps;
 2  
 
 3  195
 public class Timer {
 4  
     private long start;
 5  
 
 6  
     public Timer start() {
 7  195
         start = System.currentTimeMillis();
 8  195
         return this;
 9  
     }
 10  
 
 11  
     /**
 12  
      * @return the milliseconds elapsed since the timer was started, or zero if the timer was never started
 13  
      */
 14  
     public long stop() {
 15  193
         if (start == 0)
 16  0
             return 0;
 17  193
         return System.currentTimeMillis() - start;
 18  
     }
 19  
 }