/** * Returns the elapsed time in seconds; does not stop the timer, if started. */ public double seconds() { return (nanos()) / 1000000000.0; }
/** * Returns the elapsed time in seconds; does not stop the timer, if started. */ public double seconds() { return (nanos()) / 1000000000.0; }
/** * <tt>T = this + other</tt>; Constructs and returns a new timer which is * the sum of the receiver and the other timer. The new timer is not * started. * * @param other * the timer to add. * @return a new timer. */ public Timer plus(Timer other) { Timer copy = new Timer(); copy.elapsedTime = nanos() + other.nanos(); return copy; }
/** * <tt>T = this - other</tt>; Constructs and returns a new timer which is * the difference of the receiver and the other timer. The new timer is not * started. * * @param other * the timer to subtract. * @return a new timer. */ public Timer minus(Timer other) { Timer copy = new Timer(); copy.elapsedTime = nanos() - other.nanos(); return copy; }
/** * <tt>T = this + other</tt>; Constructs and returns a new timer which is * the sum of the receiver and the other timer. The new timer is not * started. * * @param other * the timer to add. * @return a new timer. */ public Timer plus(Timer other) { Timer copy = new Timer(); copy.elapsedTime = nanos() + other.nanos(); return copy; }
/** * <tt>T = this - other</tt>; Constructs and returns a new timer which is * the difference of the receiver and the other timer. The new timer is not * started. * * @param other * the timer to subtract. * @return a new timer. */ public Timer minus(Timer other) { Timer copy = new Timer(); copy.elapsedTime = nanos() - other.nanos(); return copy; }