Stopwatch is an abstract class . We can extend or create an anonymous class and override the methods and obtain the times that it took for a test to run.