Spaces:
Sleeping
Sleeping
Download LightZero/lzero/mcts/ctree/common_lib/utils.cpp from OpenDILabCommunity/gomoku: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/spaces/OpenDILabCommunity/gomoku/resolve/main/LightZero/lzero/mcts/ctree/common_lib/utils.cpp
- Command line
-
hf download hf://spaces/OpenDILabCommunity/gomoku/LightZero/lzero/mcts/ctree/common_lib/utils.cpp
-
curl -L -o utils.cpp https://huggingface.co/spaces/OpenDILabCommunity/gomoku/resolve/main/LightZero/lzero/mcts/ctree/common_lib/utils.cpp
505 Bytes
| // C++11 | |
| void get_time_and_set_rand_seed() | |
| { | |
| FILETIME ft; | |
| GetSystemTimeAsFileTime(&ft); | |
| ULARGE_INTEGER uli; | |
| uli.LowPart = ft.dwLowDateTime; | |
| uli.HighPart = ft.dwHighDateTime; | |
| uint64_t timestamp = (uli.QuadPart - 116444736000000000ULL) / 10000000ULL; | |
| srand(timestamp % RAND_MAX); | |
| timeval tv; | |
| gettimeofday(&tv, nullptr); | |
| srand(tv.tv_usec); | |
| } |