#include <bu/sio.h>
#include <bu/speedometer.h>
#include <bu/thread.h>

#include <unistd.h>

class Report : public Bu::Thread
{
public:
    Report() :
        sKeys( 500, 8 )
    {
    }

    ~Report()
    {
    }

    Bu::Speedometer sKeys;
    bool bRunning;

protected:
    virtual void run()
    {
        bRunning = true;
        while( bRunning )
        {
            usleep( 500000 );
//            Bu::println("Speed: %1 - %2 k/s").arg( sKeys.getTotalEvents() ).
//                arg( sKeys.getSpeed() );
        }
    }
};

int main( int argc, char *argv[] )
{
    Report r;

    r.start();

    for(;;)
    {
        getchar();
        r.sKeys.addEvent();
        r.sKeys.debug();
    }


    return 0;
}

