mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Rewrite time measurement code
Introduce and use a new Time class designed after QTime, from Qt framework. Should be a more clear and self documented code. As an added benefit we now use 64 bits internally to get millisecs from system time. This avoids to wrap around to 0 every 2^32 milliseconds, which is 49.71 days. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -342,7 +342,7 @@ namespace {
|
||||
|
||||
Book::Book() : size(0) {
|
||||
|
||||
for (int i = abs(system_time() % 10000); i > 0; i--)
|
||||
for (int i = Time::current_time().msec() % 10000; i > 0; i--)
|
||||
RKiss.rand<unsigned>(); // Make random number generation less deterministic
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user