Added missing file manual to repo

This commit is contained in:
2025-12-20 16:33:00 +01:00
parent 554c4a96cb
commit 65f4d7702e
7 changed files with 701 additions and 0 deletions

56
bc.cpp Normal file
View File

@@ -0,0 +1,56 @@
#include <QElapsedTimer>
#include <QApplication>
#include <QChar>
#include <bc.h>
#include <chrono>
#include <thread>
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