Skip to content

Commit fd24695

Browse files
committed
Time: Make HighResolutionCounter::snap return reference to HighResolutionCounter itself
1 parent b90f05c commit fd24695

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Libraries/Time/Time.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SC::Time::HighResolutionCounter::HighResolutionCounter()
102102
#endif
103103
}
104104

105-
void SC::Time::HighResolutionCounter::snap()
105+
SC::Time::HighResolutionCounter& SC::Time::HighResolutionCounter::snap()
106106
{
107107
#if SC_PLATFORM_WINDOWS
108108
LARGE_INTEGER performanceCounter;
@@ -121,6 +121,7 @@ void SC::Time::HighResolutionCounter::snap()
121121
part1 = ts.tv_sec;
122122
part2 = ts.tv_nsec;
123123
#endif
124+
return *this;
124125
}
125126

126127
SC::Time::HighResolutionCounter SC::Time::HighResolutionCounter::offsetBy(Milliseconds other) const

Libraries/Time/Time.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct SC::Time::HighResolutionCounter
131131
/// @n
132132
/// Example:
133133
/// @snippet Libraries/Time/Tests/TimeTest.cpp highResolutionCounterSnapSnippet
134-
void snap();
134+
HighResolutionCounter& snap();
135135

136136
/// @brief Returns a HighResolutionCounter offset by a given number of Milliseconds
137137
/// @param ms How many Milliseconds the returned HighResolutionCounter must be offset of

0 commit comments

Comments
 (0)