mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-28 20:29:03 +00:00
Utilities: Use ElapsedTimer::start_new() in disk_bechmark
This commit is contained in:
parent
a2ee387683
commit
74ee7cabf2
Notes:
sideshowbarker
2024-07-18 04:07:07 +09:00
Author: https://github.com/bgianfo
Commit: 74ee7cabf2
Pull-request: https://github.com/SerenityOS/serenity/pull/9999
Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 2 additions and 4 deletions
|
@ -103,8 +103,7 @@ int main(int argc, char** argv)
|
||||||
Vector<Result> results;
|
Vector<Result> results;
|
||||||
|
|
||||||
outln("Running: file_size={} block_size={}", file_size, block_size);
|
outln("Running: file_size={} block_size={}", file_size, block_size);
|
||||||
Core::ElapsedTimer timer;
|
auto timer = Core::ElapsedTimer::start_new();
|
||||||
timer.start();
|
|
||||||
while (timer.elapsed() < time_per_benchmark * 1000) {
|
while (timer.elapsed() < time_per_benchmark * 1000) {
|
||||||
out(".");
|
out(".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
@ -145,8 +144,7 @@ Optional<Result> benchmark(const String& filename, int file_size, int block_size
|
||||||
|
|
||||||
Result result;
|
Result result;
|
||||||
|
|
||||||
Core::ElapsedTimer timer;
|
auto timer = Core::ElapsedTimer::start_new();
|
||||||
timer.start();
|
|
||||||
|
|
||||||
ssize_t total_written = 0;
|
ssize_t total_written = 0;
|
||||||
for (ssize_t j = 0; j < file_size; j += block_size) {
|
for (ssize_t j = 0; j < file_size; j += block_size) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue