tests/unit/apex/annotation_check.cpp
void dummy_task(std::size_t n)
{
    // no other work can take place on this thread whilst it sleeps
    bool sleep = true;
    auto start = std::chrono::steady_clock::now();
    do
    {
        std::this_thread::sleep_for(std::chrono::microseconds(n) / 25);
        auto now = std::chrono::steady_clock::now();
        auto elapsed =
            std::chrono::duration_cast<std::chrono::microseconds>(now - start);
        sleep = (elapsed < std::chrono::microseconds(n));
    } while (sleep);
}
// --------------------------------------------------------------------------
// dummy function that just triggers a delay that can be seen in task plots
dummy function that just triggers a delay that can be seen in task plots
dummy function that just triggers a delay that can be seen in task plots
void dummy_task(std::size_t n)
{
    bool sleep = true;
    auto start = std::chrono::steady_clock::now();
    do
    {
        std::this_thread::sleep_for(std::chrono::microseconds(n) / 25);
        auto now = std::chrono::steady_clock::now();
        auto elapsed =
            std::chrono::duration_cast<std::chrono::microseconds>(now - start);
        sleep = (elapsed < std::chrono::microseconds(n));
    } while (sleep);
}
void dummy_task ( std :: size_t n ) { bool sleep = true ; auto start = std :: chrono :: steady_clock :: now ( ) ; do { std :: this_thread :: sleep_for ( std :: chrono :: microseconds ( n ) / 25 ) ; auto now = std :: chrono :: steady_clock :: now ( ) ; auto elapsed = std :: chrono :: duration_cast < std :: chrono :: microseconds > ( now - start ) ; sleep = ( elapsed < std :: chrono :: microseconds ( n ) ) ; } while ( sleep ) ; }
dummy function that just triggers a delay that can be seen in task plots
dummy function that just triggers a delay that can be seen in task plots
// no other work can take place on this thread whilst it sleeps