public long getMillisAndRestart() { long now = now(); long retVal = now - myStarted; myStarted = now; return retVal; }
public long getMillis() { long now = now(); return now - myStarted; }
public void restart() { myStarted = now(); }
/** * Finish the counter on the current task (which was started by calling * {@link #startTask(String)}. This method has no effect if no task * is currently started so it's ok to call it more than once. */ public void endCurrentTask() { ensureTasksListExists(); if (myCurrentTask != null) { myCurrentTask.setEnd(now()); } myCurrentTask = null; }
/** * Starts a counter for a sub-task * <p> * <b>Thread Safety Note: </b> This method is not threadsafe! Do not use subtasks in a * multithreaded environment. * </p> * * @param theTaskName Note that if theTaskName is blank or empty, no task is started */ public void startTask(String theTaskName) { endCurrentTask(); if (isNotBlank(theTaskName)) { myCurrentTask = new TaskTiming() .setTaskName(theTaskName) .setStart(now()); myTasks.add(myCurrentTask); } }
long delta = now() - myTasks.getLast().getEnd(); if (delta > 10) { addNewlineIfContentExists(b);
public long getMillisAndRestart() { long now = now(); long retVal = now - myStarted; myStarted = now; return retVal; }
public long getMillis() { long now = now(); return now - myStarted; }
public void restart() { myStarted = now(); }
/** * Finish the counter on the current task (which was started by calling * {@link #startTask(String)}. This method has no effect if no task * is currently started so it's ok to call it more than once. */ public void endCurrentTask() { ensureTasksListExists(); if (myCurrentTask != null) { myCurrentTask.setEnd(now()); } myCurrentTask = null; }
/** * Starts a counter for a sub-task * <p> * <b>Thread Safety Note: </b> This method is not threadsafe! Do not use subtasks in a * multithreaded environment. * </p> * * @param theTaskName Note that if theTaskName is blank or empty, no task is started */ public void startTask(String theTaskName) { endCurrentTask(); if (isNotBlank(theTaskName)) { myCurrentTask = new TaskTiming() .setTaskName(theTaskName) .setStart(now()); myTasks.add(myCurrentTask); } }
long delta = now() - myTasks.getLast().getEnd(); if (delta > 10) { addNewlineIfContentExists(b);