replace std::this_thread::sleep_for with util::sleep_fo (#19717)

pull/19723/head
Dean Lee 2021-01-11 18:59:48 +08:00 committed by GitHub
parent d34a690136
commit 72bb55247c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ int main() {
#else
// Just run at 1Hz on apple
while (!do_exit){
std::this_thread::sleep_for(std::chrono::seconds(1));
util::sleep_for(1000);
#endif
uint64_t boottime = nanos_since_boot();

View File

@ -216,7 +216,7 @@ void encoder_thread(int cam_idx) {
VisionIpcClient vipc_client = VisionIpcClient("camerad", cam_info.stream_type, false);
while (!do_exit) {
if (!vipc_client.connect(false)){
std::this_thread::sleep_for(std::chrono::milliseconds(100));
util::sleep_for(100);
continue;
}

View File

@ -30,7 +30,7 @@ int main(int argc, char **argv) {
VisionIpcClient vipc_client = VisionIpcClient("camerad", VISION_STREAM_YUV_FRONT, true);
while (!do_exit){
if (!vipc_client.connect(false)){
std::this_thread::sleep_for(std::chrono::milliseconds(100));
util::sleep_for(100);
continue;
}
break;

View File

@ -122,7 +122,7 @@ int main(int argc, char **argv) {
while (!do_exit){
if (!vipc_client.connect(false)){
std::this_thread::sleep_for(std::chrono::milliseconds(100));
util::sleep_for(100);
continue;
}
break;