diff options
author | Nico Weber <thakis@chromium.org> | 2023-05-24 08:32:20 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-24 15:50:43 +0200 |
commit | 197c5729d1e5c20cf1d3f32e7c055eb5f8ee38e8 (patch) | |
tree | 53ed0159c940c899619cb34366756603f245c8b6 /Userland | |
parent | 655d9d14628d73113d0e1a891fe79c3b3052caf3 (diff) | |
download | serenity-197c5729d1e5c20cf1d3f32e7c055eb5f8ee38e8.zip |
LibCore: Add ElapsedTimer::elapsed_milliseconds()
It does the same thing as elapsed(), but has a clearer name.
The hope is we'll move everything to the new name over time
and then remove the old name.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibCore/ElapsedTimer.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibCore/ElapsedTimer.h | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Userland/Libraries/LibCore/ElapsedTimer.cpp b/Userland/Libraries/LibCore/ElapsedTimer.cpp index 02f1802622..ea2af5d408 100644 --- a/Userland/Libraries/LibCore/ElapsedTimer.cpp +++ b/Userland/Libraries/LibCore/ElapsedTimer.cpp @@ -29,7 +29,7 @@ void ElapsedTimer::reset() m_origin_time = {}; } -i64 ElapsedTimer::elapsed() const +i64 ElapsedTimer::elapsed_milliseconds() const { return elapsed_time().to_milliseconds(); } diff --git a/Userland/Libraries/LibCore/ElapsedTimer.h b/Userland/Libraries/LibCore/ElapsedTimer.h index 16cb2a32fb..6741d242d2 100644 --- a/Userland/Libraries/LibCore/ElapsedTimer.h +++ b/Userland/Libraries/LibCore/ElapsedTimer.h @@ -23,9 +23,15 @@ public: void start(); void reset(); - i64 elapsed() const; // milliseconds + i64 elapsed_milliseconds() const; Time elapsed_time() const; + // FIXME: Move callers to elapsed_milliseconds(), remove this. + i64 elapsed() const // milliseconds + { + return elapsed_milliseconds(); + } + Time const& origin_time() const { return m_origin_time; } private: |