時計時間計算用のクラス。
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