mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibTest: Remove uses of gettimeofday in favor of AK::Time
gettimeofday is not a thing on Windows or esoteric Unixen.
This commit is contained in:
parent
88fb2b0c9f
commit
489bea0c23
Notes:
github-actions[bot]
2025-02-13 02:14:53 +00:00
Author: https://github.com/ADKaster
Commit: 489bea0c23
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3551
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/shannonbooth
2 changed files with 7 additions and 13 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Time.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -15,10 +16,8 @@ namespace Test {
|
|||
|
||||
inline double get_time_in_ms()
|
||||
{
|
||||
struct timeval tv1;
|
||||
auto return_code = gettimeofday(&tv1, nullptr);
|
||||
VERIFY(return_code >= 0);
|
||||
return static_cast<double>(tv1.tv_sec) * 1000.0 + static_cast<double>(tv1.tv_usec) / 1000.0;
|
||||
auto now = UnixDateTime::now();
|
||||
return static_cast<double>(now.milliseconds_since_epoch());
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue