mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
LibCore: Add factory to create and start a new ElapsedTimer
Simplifies one of the main usage patterns of the timer class.
This commit is contained in:
parent
500a3fb2a7
commit
a2ee387683
2 changed files with 9 additions and 0 deletions
|
@ -12,6 +12,13 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
ElapsedTimer ElapsedTimer::start_new()
|
||||
{
|
||||
ElapsedTimer timer;
|
||||
timer.start();
|
||||
return timer;
|
||||
}
|
||||
|
||||
void ElapsedTimer::start()
|
||||
{
|
||||
m_valid = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue