mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
Merge bitcoin/bitcoin#25102: Remove unused GetTimeSeconds
fab9e8a29cRemove unused GetTimeSeconds (MacroFake) Pull request description: Seems confusing to have this helper when it is possible to get the system time in a type-safe way by simply calling `std::chrono::system_clock::now` (C++11). This patch replaces `GetTimeSeconds` and removes it: * in `bitcoin-cli.cpp` by `system_clock` * in `test/fuzz/fuzz.cpp` by `steady_clock` ACKs for top commit: laanwj: Code review ACKfab9e8a29cnaumenkogs: ACKfab9e8a29cTree-SHA512: 517e300b0baf271cfbeebd4a0838871acbea9360f9dd23572a751335c20c1ba261b1b5ee0aec8a36abd20c94fab83ce94f46042745279aca1f0ca2f885a03b6e
This commit is contained in:
@@ -194,7 +194,7 @@ int main(int argc, char** argv)
|
||||
return 0;
|
||||
}
|
||||
std::signal(SIGABRT, signal_handler);
|
||||
int64_t start_time = GetTimeSeconds();
|
||||
const auto start_time{Now<SteadySeconds>()};
|
||||
int tested = 0;
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
fs::path input_path(*(argv + i));
|
||||
@@ -215,8 +215,8 @@ int main(int argc, char** argv)
|
||||
buffer.clear();
|
||||
}
|
||||
}
|
||||
int64_t end_time = GetTimeSeconds();
|
||||
std::cout << g_fuzz_target << ": succeeded against " << tested << " files in " << (end_time - start_time) << "s." << std::endl;
|
||||
const auto end_time{Now<SteadySeconds>()};
|
||||
std::cout << g_fuzz_target << ": succeeded against " << tested << " files in " << count_seconds(end_time - start_time) << "s." << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -265,9 +265,6 @@ BOOST_AUTO_TEST_CASE(util_FormatParseISO8601DateTime)
|
||||
BOOST_CHECK_EQUAL(ParseISO8601DateTime("1970-01-01T00:00:00Z"), 0);
|
||||
BOOST_CHECK_EQUAL(ParseISO8601DateTime("1960-01-01T00:00:00Z"), 0);
|
||||
BOOST_CHECK_EQUAL(ParseISO8601DateTime("2011-09-30T23:36:17Z"), 1317425777);
|
||||
|
||||
auto time = GetTimeSeconds();
|
||||
BOOST_CHECK_EQUAL(ParseISO8601DateTime(FormatISO8601DateTime(time)), time);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(util_FormatISO8601Date)
|
||||
|
||||
Reference in New Issue
Block a user