blob: dd55ca74d94097f084f5e002630f6cd672bcb2eb (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 | //
// Copyright 2016 Ettus Research
//
// SPDX-License-Identifier: GPL-3.0
//
#include <uhd/usrp/dboard_iface.hpp>
using namespace uhd::usrp;
void dboard_iface::sleep(const boost::chrono::nanoseconds& time)
{
   //nanosleep is not really accurate in userland and it is also not very
   //cross-platform. So just sleep for the minimum amount of time in us.
   if (time < boost::chrono::microseconds(1)) {
      boost::this_thread::sleep_for(boost::chrono::microseconds(1));
   } else {
      boost::this_thread::sleep_for(time);
   }
}
 |