本文整理汇总了C++中Stopwatch::Look方法的典型用法代码示例。如果您正苦于以下问题:C++ Stopwatch::Look方法的具体用法?C++ Stopwatch::Look怎么用?C++ Stopwatch::Look使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stopwatch
的用法示例。
在下文中一共展示了Stopwatch::Look方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tmp
void Benchmark::Integer16_Test()
{
double tmp(0);
double Cur_Time(0);
uint32_t loops=0;
Stopwatch watch;
watch.Start();
for( ; Cur_Time < Time_Per_Test; ++loops, watch.Look( Cur_Time ), Status_Done( static_cast< uint32_t >( Status_Mul*Cur_Time )) )
tmp += Intern_Integer16_Test();
m_Integer16_Score = static_cast< uint32_t >(tmp/loops);
}
示例2: loops
void Benchmark::Integer8_Test()
{
double Score ( 0 ),
Cur_Time( 0 );
uint32_t loops ( 0 );
Stopwatch watch;
watch.Start();
for( ; Cur_Time < Time_Per_Test; ++loops, watch.Look( Cur_Time ), Status_Done( static_cast< uint32_t >( Status_Mul*Cur_Time )) )
Score += Intern_Integer8_Test();
m_Integer8_Score = static_cast< uint32_t >(Score/loops);
}
示例3: Run
//todo: Use a typedef for the saving type
void Benchmark::Run()
{
Stopwatch watch;
uint32_t tmp_Time;
if( ::Just_Mem_Test )
tmp_Time = Time_Per_Test * 5;
else if( ::Just_Cpu_Test )
tmp_Time = Time_Per_Test * 7;
else if( ::Just_MT_Test )
tmp_Time = Time_Per_Test * 1;
else
tmp_Time = Time_Per_Test * 13;
if( No_Cpu_Test )
tmp_Time -= Time_Per_Test * 7;
if( No_Mem_Test )
tmp_Time -= Time_Per_Test * 5;
if( No_MT_Test )
tmp_Time -= Time_Per_Test * 1;
const uint32_t Time( tmp_Time );
uint32_t Loops(0);
double Re8int(0),
Re16int(0),
Re32int(0),
Re64int(0),
Re32Fp(0),
Re64Fp(0),
Re96Fp(0),
Re128Fp(0),
ReMemRW2(0),
ReMemRW4(0),
ReMemDA2(0),
ReMemDA4(0),
ReMemDA8(0),
ReMTMLuL(0);
double Cur_Time(0);
Status_Done(0);
watch.Start();
for( ; Cur_Time < Time; ++Loops, watch.Look( Cur_Time ), Status_Done( static_cast< uint32_t >( (100.0/Time)*Cur_Time )) )
{
if( !Just_Mem_Test && !Just_MT_Test && !No_Cpu_Test)
{
Re8int += static_cast< double > (Intern_Integer8_Test() );
if( m_Error )
return;
Re16int += static_cast< double > (Intern_Integer16_Test() );
if( m_Error )
return;
Re32int += static_cast< double > (Intern_Integer32_Test() );
if( m_Error )
return;
Re64int += static_cast< double > (Intern_Integer64_Test() );
Re32Fp += static_cast< double > (Intern_Fp32_Test() );
if( m_Error )
return;
Re64Fp += static_cast< double > (Intern_Fp64_Test() );
if( m_Error )
return;
if( sizeof( long double ) == 12 )
Re96Fp += static_cast< double > (Intern_Fp96_Test() );
else if( sizeof( long double ) == 16 )
Re128Fp += static_cast< double > (Intern_Fp128_Test() );
if( m_Error )
return;
}
if( !Just_Cpu_Test && !Just_MT_Test && !No_Mem_Test)
{
ReMemRW2 += static_cast< double > (Intern_Mem_RW2_Test() );
if( m_Error )
return;
ReMemRW4 += static_cast< double > (Intern_Mem_RW4_Test() );
if( m_Error )
return;
ReMemDA2 += static_cast< double > (Intern_Mem_DA2_Test() );
if( m_Error )
return;
ReMemDA8 += static_cast< double > (Intern_Mem_DA8_Test() );
if( m_Error )
return;
ReMemDA4 += static_cast< double > (Intern_Mem_DA4_Test() );
if( m_Error )
return;
}
if( !Just_Cpu_Test && !Just_Mem_Test && !No_MT_Test )
{
ReMTMLuL += static_cast< double > (Intern_MT_MLuL_Test() );
if( m_Error )
return;
}
}
if( !Just_Mem_Test && !Just_MT_Test && !No_Cpu_Test)
{
//.........这里部分代码省略.........