summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-09-12 08:47:57 -0700
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-09-12 17:24:44 +0000
commit5df74c99ab165726c751541a0319f547b17d1e27 (patch)
treed6dde65321a5639e096b05f5e51a5ab43e7918d1 /Userland/Utilities
parent74ee7cabf23f9d524bc81a90fc4b82dc6de027fc (diff)
downloadserenity-5df74c99ab165726c751541a0319f547b17d1e27.zip
Utilities: Use ElapsedTimer::start_new in allocate
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/allocate.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Utilities/allocate.cpp b/Userland/Utilities/allocate.cpp
index da932099b6..903f99f676 100644
--- a/Userland/Utilities/allocate.cpp
+++ b/Userland/Utilities/allocate.cpp
@@ -57,10 +57,8 @@ int main(int argc, char** argv)
break;
}
- Core::ElapsedTimer timer;
-
outln("allocating memory ({} bytes)...", count);
- timer.start();
+ auto timer = Core::ElapsedTimer::start_new();
char* ptr = (char*)malloc(count);
if (!ptr) {
outln("failed.");
@@ -71,11 +69,9 @@ int main(int argc, char** argv)
auto pages = count / PAGE_SIZE;
auto step = pages / 10;
- Core::ElapsedTimer timer2;
-
outln("writing one byte to each page of allocated memory...");
timer.start();
- timer2.start();
+ auto timer2 = Core::ElapsedTimer::start_new();
for (int i = 0; i < pages; ++i) {
ptr[i * PAGE_SIZE] = 1;