tick_count クラス

概要

時計時間計算用のクラス。

構文

class tick_count;

ヘッダー

#include "tbb/tick_count.h"

説明

tick_count は、絶対タイムスタンプです。2 つの tick_count オブジェクトを別のオブジェクトから引いて相対時間 tick_count::interval_t を計算します。この時間は秒に変換できます。

Linux* では、tbb::tick_count クラスを使用するときリンカーコマンドに -lrt を追加する必要があります。

サンプル

using namespace tbb;

void Foo() {
    tick_count t0 = tick_count::now();
    ...action being timed...
    tick_count t1 = tick_count::now();
    printf("time for action = %g seconds\n", (t1-t0).seconds() );
}
      

メンバー

namespace tbb {

    class tick_count {
    public:
        class interval_t;
        static tick_count now();
        static double resolution();
    };

    tick_count::interval_t  operator-( const tick_count&  t1, const tick_count& t0 );
} // tbb