-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimeman.hpp
More file actions
31 lines (28 loc) · 787 Bytes
/
timeman.hpp
File metadata and controls
31 lines (28 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <chrono>
#include "eval.hpp"
constexpr int INFINITE_TIME = 86400000;
struct TimeControl
{
int wtime = INFINITE_TIME;
int btime = INFINITE_TIME;
int winc = 0;
int binc = 0;
int movestogo = 40;
int movetime = INFINITE_TIME;
uint8_t depth = MAX_PLY;
bool infinite = false;
bool white_to_move = true;
};
namespace timeman
{
extern std::chrono::time_point<std::chrono::high_resolution_clock> start_time;
extern std::chrono::milliseconds time_buffer;
extern std::chrono::milliseconds inc;
extern std::chrono::milliseconds time_limit;
extern int moves_to_go;
extern bool infinite;
bool check_time();
// Set time control limits using the TimeControl struct
void setLimits(const TimeControl &tc);
}