コード例 #1
0
void MediumModeWindow::startTime()
{
    _chronometre = new QTimer;
    _chronometre->start(1000);
    connect(_chronometre, SIGNAL(timeout()), this, SLOT(newSecond()));
    connect(this, SIGNAL(addSeconde(int)), this, SLOT(updateLabel(int)));
}
コード例 #2
0
ファイル: Telemetry.cpp プロジェクト: ace13/ld26
void Telemetry::endFrame()
{
    sf::Time end = mClock.getElapsedTime();
    sf::Time frameLen = end-mStart;
    mLastSecond += frameLen;

    ++mFrames;

    pushDT(frameLen.asSeconds());

    if (mLastSecond.asSeconds() > 1)
    {
        mLastSecond = sf::milliseconds(0);

        pushFPS(mFrames);
        mFrames = 0;

        newSecond();
    }
}