本文整理汇总了C++中Timer::GetFrequency方法的典型用法代码示例。如果您正苦于以下问题:C++ Timer::GetFrequency方法的具体用法?C++ Timer::GetFrequency怎么用?C++ Timer::GetFrequency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::GetFrequency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char ** argv)
{
Rand::Randomize();
size_t total_tests = 0;
size_t total_good_tests = 0;
ConsoleParameters params(argc, argv);
print_debug_info = params.has(" -p | --print ");
N = params.get(" -c | --count ", 1000);
std::string mode_s = params.get<std::string>(" -m | --mode ", "min");
if (mode_s.compare("min") == 0)
{
mode = mode_min;
}
else if (mode_s.compare("max") == 0)
{
mode = mode_max;
}
else if (mode_s.compare("sum") == 0)
{
mode = mode_sum;
}
else if (mode_s.compare("avg") == 0)
{
mode = mode_avg;
}
if (params.has(" -h | --help | --usage "))
{
std::cout << "-p, --print -- print debug info\n";
std::cout << "-c, --count -- count operations in tests\n";
std::cout << "-m, --mode {sum, max, min - by default, avg}\n";
return 0;
}
Timer timer;
FR = timer.GetFrequency();
timer.Start();
std::cout << "Tests:\n";
TEST (performance_test_vector_add, "performance_test_vector_add")
TEST (performance_test_vector_big_add, "performance_test_vector_big_add")
TEST (performance_test_ray_cross_triangle_ok, "performance_test_ray_cross_triangle_ok")
TEST (performance_test_timer, "performance_test_timer")
timer.Stop();
std::cout.setf( std::ios::right );
std::cout << "\n" << std::setfill('0') << std::setw(3) << total_good_tests << " / " << std::setw(3) << total_tests << " passed. "
<< " " << std::setw(3) << total_tests - total_good_tests << " errors.\n\n";
std::cout << "Time: " << std::fixed << std::setprecision(8) << timer.GetTotalTimeInSeconds() << " sec. \n\n";
return 0;
}