Bitcoin ABC  0.24.7
P2P Digital Currency
util.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2019 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_SEEDER_UTIL_H
6 #define BITCOIN_SEEDER_UTIL_H
7 
8 #include <ctime>
9 
10 #define BEGIN(a) ((char *)&(a))
11 #define END(a) ((char *)&((&(a))[1]))
12 
13 static inline void Sleep(int nMilliSec) {
14  struct timespec wa;
15  wa.tv_sec = nMilliSec / 1000;
16  wa.tv_nsec = (nMilliSec % 1000) * 1000000;
17  nanosleep(&wa, nullptr);
18 }
19 
20 #endif // BITCOIN_SEEDER_UTIL_H
Sleep
static void Sleep(int nMilliSec)
Definition: util.h:13