mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 21:40:33 +00:00
Userland: Stop passing ignored timezones to gettimeofday
This commit is contained in:
parent
ab87d42200
commit
88319b188e
Notes:
sideshowbarker
2024-07-19 03:05:00 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/88319b188e1 Pull-request: https://github.com/SerenityOS/serenity/pull/3321
3 changed files with 8 additions and 11 deletions
|
@ -58,7 +58,6 @@ static bool in_ci = false;
|
|||
static struct timeval start_time {
|
||||
0, 0
|
||||
};
|
||||
static struct timezone tz;
|
||||
static bool g_some_test_failed = false;
|
||||
static bool encrypting = true;
|
||||
|
||||
|
@ -476,18 +475,18 @@ auto main(int argc, char** argv) -> int
|
|||
return 1;
|
||||
}
|
||||
|
||||
#define I_TEST(thing) \
|
||||
{ \
|
||||
printf("Testing " #thing "... "); \
|
||||
fflush(stdout); \
|
||||
gettimeofday(&start_time, &tz); \
|
||||
#define I_TEST(thing) \
|
||||
{ \
|
||||
printf("Testing " #thing "... "); \
|
||||
fflush(stdout); \
|
||||
gettimeofday(&start_time, nullptr); \
|
||||
}
|
||||
#define PASS \
|
||||
{ \
|
||||
struct timeval end_time { \
|
||||
0, 0 \
|
||||
}; \
|
||||
gettimeofday(&end_time, &tz); \
|
||||
gettimeofday(&end_time, nullptr); \
|
||||
time_t interval_s = end_time.tv_sec - start_time.tv_sec; \
|
||||
suseconds_t interval_us = end_time.tv_usec; \
|
||||
if (interval_us < start_time.tv_usec) { \
|
||||
|
|
|
@ -163,8 +163,7 @@ static void handle_sigabrt(int)
|
|||
static double get_time_in_ms()
|
||||
{
|
||||
struct timeval tv1;
|
||||
struct timezone tz1;
|
||||
auto return_code = gettimeofday(&tv1, &tz1);
|
||||
auto return_code = gettimeofday(&tv1, nullptr);
|
||||
ASSERT(return_code >= 0);
|
||||
return static_cast<double>(tv1.tv_sec) * 1000.0 + static_cast<double>(tv1.tv_usec) / 1000.0;
|
||||
}
|
||||
|
|
|
@ -183,8 +183,7 @@ static void handle_sigabrt(int)
|
|||
static double get_time_in_ms()
|
||||
{
|
||||
struct timeval tv1;
|
||||
struct timezone tz1;
|
||||
auto return_code = gettimeofday(&tv1, &tz1);
|
||||
auto return_code = gettimeofday(&tv1, nullptr);
|
||||
ASSERT(return_code >= 0);
|
||||
return static_cast<double>(tv1.tv_sec) * 1000.0 + static_cast<double>(tv1.tv_usec) / 1000.0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue