We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e92b576 commit 1d4be9cCopy full SHA for 1d4be9c
Userland/Libraries/LibCore/ElapsedTimer.cpp
@@ -34,4 +34,9 @@ int ElapsedTimer::elapsed() const
34
return diff.tv_sec * 1000 + diff.tv_usec / 1000;
35
}
36
37
+Time ElapsedTimer::elapsed_time() const
38
+{
39
+ return Time::from_milliseconds(elapsed());
40
+}
41
+
42
Userland/Libraries/LibCore/ElapsedTimer.h
@@ -6,6 +6,7 @@
6
7
#pragma once
8
9
+#include <AK/Time.h>
10
#include <sys/time.h>
11
12
namespace Core {
@@ -20,6 +21,7 @@ class ElapsedTimer {
20
21
bool is_valid() const { return m_valid; }
22
void start();
23
int elapsed() const;
24
+ Time elapsed_time() const;
25
26
const struct timeval& origin_time() const { return m_origin_time; }
27
0 commit comments