]> git.sesse.net Git - stockfish/commit
Fix random moves when time < 10ms
authorMarco Costalba <mcostalba@gmail.com>
Tue, 10 Sep 2013 19:14:09 +0000 (21:14 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 10 Sep 2013 19:23:20 +0000 (21:23 +0200)
commit49e110c52b19f5c99954d4797b8e991b0b60007c
tree61fd484e74ab3976fedd6a95339919f2e97e6763
parent4d90aeb0ab962e6a0b4b53bf11f5003bcc813251
Fix random moves when time < 10ms

In case we have less then 10ms to think as soon as
we wake up the timer, it immediately fires and calls
check_time() where due to condition:

elapsed > TimeMgr.maximum_time() - 2 * TimerResolution

the stop flag is set and search returns immediately, without
actually search anything.

Here the somewhat hacky fix is to start the timer after
at least one iteration as been completed.

No functional change.
src/search.cpp