summaryrefslogtreecommitdiff
path: root/src/common/timer.h
diff options
context:
space:
mode:
authorGravatar Lioncash2020-08-14 09:38:45 -0400
committerGravatar Lioncash2020-08-15 17:17:52 -0400
commitdf7248039553b3ebd338380c3ef0428b0e046e79 (patch)
treeeca7153300e311ac7954f5c085fdada0c7295699 /src/common/timer.h
parentMerge pull request #4526 from lioncash/core-semi (diff)
downloadyuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.gz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.xz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.zip
common: Make use of [[nodiscard]] where applicable
Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions.
Diffstat (limited to 'src/common/timer.h')
-rw-r--r--src/common/timer.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/timer.h b/src/common/timer.h
index 27b521baa..8894a143d 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -19,18 +19,18 @@ public:
19 19
20 // The time difference is always returned in milliseconds, regardless of alternative internal 20 // The time difference is always returned in milliseconds, regardless of alternative internal
21 // representation 21 // representation
22 std::chrono::milliseconds GetTimeDifference(); 22 [[nodiscard]] std::chrono::milliseconds GetTimeDifference();
23 void AddTimeDifference(); 23 void AddTimeDifference();
24 24
25 static std::chrono::seconds GetTimeSinceJan1970(); 25 [[nodiscard]] static std::chrono::seconds GetTimeSinceJan1970();
26 static std::chrono::seconds GetLocalTimeSinceJan1970(); 26 [[nodiscard]] static std::chrono::seconds GetLocalTimeSinceJan1970();
27 static double GetDoubleTime(); 27 [[nodiscard]] static double GetDoubleTime();
28 28
29 static std::string GetTimeFormatted(); 29 [[nodiscard]] static std::string GetTimeFormatted();
30 std::string GetTimeElapsedFormatted() const; 30 [[nodiscard]] std::string GetTimeElapsedFormatted() const;
31 std::chrono::milliseconds GetTimeElapsed(); 31 [[nodiscard]] std::chrono::milliseconds GetTimeElapsed();
32 32
33 static std::chrono::milliseconds GetTimeMs(); 33 [[nodiscard]] static std::chrono::milliseconds GetTimeMs();
34 34
35private: 35private:
36 std::chrono::milliseconds m_LastTime; 36 std::chrono::milliseconds m_LastTime;