#include #include #include #include #include #include namespace bc { void delay_seconds( uint32_t tval ) { std::this_thread::sleep_for(std::chrono::seconds( tval ) ); } void delay_millis( uint32_t tval ) { std::this_thread::sleep_for(std::chrono::milliseconds( tval ) ); } void delay_micros( uint32_t tval ) { std::this_thread::sleep_for(std::chrono::microseconds( tval ) ); } /** * @brief Macht aus int x den String 000x zum schönaussehen. * @param count der Wert * @param len die voranzustellenden Nullen * * Macht aus int x den String 000x zum schönaussehen. * */ QString formatInt( int count, int len ) { QString result( "%0" ); result = result.arg( count, len, 10, QChar( '0' ) ); return result; } void processEventsFor(int milliseconds) { QElapsedTimer timer; timer.start(); while (timer.elapsed() < milliseconds) { QApplication::processEvents(QEventLoop::AllEvents, 50); } } } // namespace cbc