mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Rename current_time() to now()
Follow C++11 naming conventions. No functional change.
This commit is contained in:
parent
e6d8e74152
commit
5900ab76a0
6 changed files with 9 additions and 9 deletions
|
@ -111,7 +111,7 @@ void benchmark(const Position& current, istream& is) {
|
||||||
|
|
||||||
int64_t nodes = 0;
|
int64_t nodes = 0;
|
||||||
Search::StateStackPtr st;
|
Search::StateStackPtr st;
|
||||||
Time time = Time::current_time();
|
Time time = Time::now();
|
||||||
|
|
||||||
for (size_t i = 0; i < fens.size(); i++)
|
for (size_t i = 0; i < fens.size(); i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -340,7 +340,7 @@ namespace {
|
||||||
|
|
||||||
Book::Book() {
|
Book::Book() {
|
||||||
|
|
||||||
for (int i = Time::current_time().msec() % 10000; i > 0; i--)
|
for (int i = Time::now().msec() % 10000; i > 0; i--)
|
||||||
RKiss.rand<unsigned>(); // Make random number generation less deterministic
|
RKiss.rand<unsigned>(); // Make random number generation less deterministic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ void timed_wait(WaitCondition& sleepCond, Lock& sleepLock, int msec) {
|
||||||
int tm = msec;
|
int tm = msec;
|
||||||
#else
|
#else
|
||||||
timespec ts, *tm = &ts;
|
timespec ts, *tm = &ts;
|
||||||
uint64_t ms = Time::current_time().msec() + msec;
|
uint64_t ms = Time::now().msec() + msec;
|
||||||
|
|
||||||
ts.tv_sec = ms / 1000;
|
ts.tv_sec = ms / 1000;
|
||||||
ts.tv_nsec = (ms % 1000) * 1000000LL;
|
ts.tv_nsec = (ms % 1000) * 1000000LL;
|
||||||
|
|
|
@ -46,9 +46,9 @@ struct Log : public std::ofstream {
|
||||||
|
|
||||||
struct Time {
|
struct Time {
|
||||||
int64_t msec() const { return time_to_msec(t); }
|
int64_t msec() const { return time_to_msec(t); }
|
||||||
int elapsed() const { return int(current_time().msec() - msec()); }
|
int elapsed() const { return int(now().msec() - msec()); }
|
||||||
|
|
||||||
static Time current_time() { Time t; system_time(&t.t); return t; }
|
static Time now() { Time t; system_time(&t.t); return t; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
sys_time_t t;
|
sys_time_t t;
|
||||||
|
|
|
@ -1494,7 +1494,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
static RKISS rk;
|
static RKISS rk;
|
||||||
|
|
||||||
// PRNG sequence should be not deterministic
|
// PRNG sequence should be not deterministic
|
||||||
for (int i = Time::current_time().msec() % 50; i > 0; i--)
|
for (int i = Time::now().msec() % 50; i > 0; i--)
|
||||||
rk.rand<unsigned>();
|
rk.rand<unsigned>();
|
||||||
|
|
||||||
// RootMoves are already sorted by score in descending order
|
// RootMoves are already sorted by score in descending order
|
||||||
|
@ -1749,11 +1749,11 @@ void Thread::idle_loop() {
|
||||||
|
|
||||||
void check_time() {
|
void check_time() {
|
||||||
|
|
||||||
static Time lastInfoTime = Time::current_time();
|
static Time lastInfoTime = Time::now();
|
||||||
|
|
||||||
if (lastInfoTime.elapsed() >= 1000)
|
if (lastInfoTime.elapsed() >= 1000)
|
||||||
{
|
{
|
||||||
lastInfoTime = Time::current_time();
|
lastInfoTime = Time::now();
|
||||||
dbg_print();
|
dbg_print();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -417,7 +417,7 @@ void ThreadPool::start_searching(const Position& pos, const LimitsType& limits,
|
||||||
const std::vector<Move>& searchMoves, StateStackPtr& states) {
|
const std::vector<Move>& searchMoves, StateStackPtr& states) {
|
||||||
wait_for_search_finished();
|
wait_for_search_finished();
|
||||||
|
|
||||||
SearchTime = Time::current_time(); // As early as possible
|
SearchTime = Time::now(); // As early as possible
|
||||||
|
|
||||||
Signals.stopOnPonderhit = Signals.firstRootMove = false;
|
Signals.stopOnPonderhit = Signals.firstRootMove = false;
|
||||||
Signals.stop = Signals.failedLowAtRoot = false;
|
Signals.stop = Signals.failedLowAtRoot = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue