summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCore/ElapsedTimer.cpp7
-rw-r--r--Userland/Libraries/LibCore/ElapsedTimer.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/ElapsedTimer.cpp b/Userland/Libraries/LibCore/ElapsedTimer.cpp
index 96490310cf..59b4b4cd95 100644
--- a/Userland/Libraries/LibCore/ElapsedTimer.cpp
+++ b/Userland/Libraries/LibCore/ElapsedTimer.cpp
@@ -12,6 +12,13 @@
namespace Core {
+ElapsedTimer ElapsedTimer::start_new()
+{
+ ElapsedTimer timer;
+ timer.start();
+ return timer;
+}
+
void ElapsedTimer::start()
{
m_valid = true;
diff --git a/Userland/Libraries/LibCore/ElapsedTimer.h b/Userland/Libraries/LibCore/ElapsedTimer.h
index d675802178..f230f34068 100644
--- a/Userland/Libraries/LibCore/ElapsedTimer.h
+++ b/Userland/Libraries/LibCore/ElapsedTimer.h
@@ -13,6 +13,8 @@ namespace Core {
class ElapsedTimer {
public:
+ static ElapsedTimer start_new();
+
ElapsedTimer(bool precise = false)
: m_precise(precise)
{