diff --git a/src/main/java/org/apache/commons/lang3/time/StopWatch.java b/src/main/java/org/apache/commons/lang3/time/StopWatch.java
index 239bc5161..a5f53a3dd 100644
--- a/src/main/java/org/apache/commons/lang3/time/StopWatch.java
+++ b/src/main/java/org/apache/commons/lang3/time/StopWatch.java
@@ -23,7 +23,7 @@ package org.apache.commons.lang3.time;
*
*
*
- * To start the watch, call {@link #start()}. At this point you can:
+ * To start the watch, call {@link #start()} or {@link StopWatch.createStarted()}. At this point you can:
*
*
* - {@link #split()} the watch to get the time whilst the watch continues in the background. {@link #unsplit()} will
@@ -57,6 +57,20 @@ package org.apache.commons.lang3.time;
public class StopWatch {
private static final long NANO_2_MILLIS = 1000000L;
+
+
+ /**
+ * Provides a started stopwatch for convenience.
+ *
+ * @return StopWatch a stopwatch that's already been started.
+ *
+ * @since 3.5
+ */
+ public static StopWatch createStarted() {
+ StopWatch sw = new StopWatch();
+ sw.start();
+ return sw;
+ }
/**
* Enumeration type which indicates the status of stopwatch.
diff --git a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
index f4ec34780..80a4242ce 100644
--- a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
@@ -45,6 +45,12 @@ public class StopWatchTest {
watch.reset();
assertEquals(0, watch.getTime());
}
+
+ @Test
+ public void testStopWatchStatic() {
+ final StopWatch watch = StopWatch.createStarted();
+ assertTrue(watch.isStarted());
+ }
@Test
public void testStopWatchSimpleGet(){