From 27ac99806e098a3c473241aa516c5111dd53f965 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Tue, 17 Mar 2020 15:12:21 +0100 Subject: [PATCH] Stopwatch: added restart() method --- src/storm/utility/Stopwatch.cpp | 5 +++++ src/storm/utility/Stopwatch.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/storm/utility/Stopwatch.cpp b/src/storm/utility/Stopwatch.cpp index f694df496..b863c8da5 100644 --- a/src/storm/utility/Stopwatch.cpp +++ b/src/storm/utility/Stopwatch.cpp @@ -55,6 +55,11 @@ namespace storm { isStopped = true; } + void Stopwatch::restart() { + reset(); + start(); + } + bool Stopwatch::stopped() const { return isStopped; } diff --git a/src/storm/utility/Stopwatch.h b/src/storm/utility/Stopwatch.h index e3b41f4e9..c90bd8c7e 100644 --- a/src/storm/utility/Stopwatch.h +++ b/src/storm/utility/Stopwatch.h @@ -66,6 +66,11 @@ namespace storm { */ void reset(); + /*! + * Reset the stopwatch and immediately start it + */ + void restart(); + /*! * Retrieves whether the watch is stopped. */