YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ytest::timing 命名空间参考

计时测试工具命名空间。 更多...

函数

template<typename _fNow , typename _fCallable , typename... _tParams>
auto once (_fNow now, _fCallable &&f, _tParams &&...args) -> decltype(now()-now())
 测试指定函数执行一次的时间。
 
template<typename _fCallable , typename... _tParams>
double once_c (_fCallable &&f, _tParams &&...args)
 测试指定函数执行一次的时间。
 
template<class _fNow , typename _fCallable , typename... _tParams>
auto total (size_t n, _fNow now, _fCallable &&f, _tParams &&...args) -> decltype(now()-now())
 测试指定函数执行若干次的总时间。
 
template<typename _fCallable , typename... _tParams>
double total_c (size_t n, _fCallable &&f, _tParams &&...args)
 测试指定函数执行若干次的总时间。
 
template<typename... _tParams>
auto average (size_t n, _tParams &&...args) -> decltype(timing::total(n, std::forward< decltype(args)>(args)...)/n)
 测试指定函数执行若干次的平均时间。
 

详细描述

计时测试工具命名空间。

自从
build 319

函数说明

template<typename... _tParams>
auto ytest::timing::average ( size_t  n,
_tParams &&...  args 
) -> decltype(timing::total(n, std::forward<decltype( args )>( args )...) / n)
inline

测试指定函数执行若干次的平均时间。

自从
build 319

在文件 timing.hpp129 行定义.

参考 total() , 以及 yforward.

函数调用图:

template<typename _fNow , typename _fCallable , typename... _tParams>
auto ytest::timing::once ( _fNow  now,
_fCallable &&  f,
_tParams &&...  args 
) -> decltype(now() - now())
inline

测试指定函数执行一次的时间。

注解
使用 _fNow 函数指定当前时刻进行计时。
自从
build 327

在文件 timing.hpp64 行定义.

参考 yforward.

参考自 FetchImage().

这是这个函数的调用关系图:

template<typename _fCallable , typename... _tParams>
double ytest::timing::once_c ( _fCallable &&  f,
_tParams &&...  args 
)
inline

测试指定函数执行一次的时间。

注解
使用 std::clock() 计时。
自从
build 327

在文件 timing.hpp79 行定义.

参考 yforward.

template<class _fNow , typename _fCallable , typename... _tParams>
auto ytest::timing::total ( size_t  n,
_fNow  now,
_fCallable &&  f,
_tParams &&...  args 
) -> decltype(now() - now())
inline

测试指定函数执行若干次的总时间。

注解
使用 _tClock 时钟类计时。
前置条件
_tClock 满足 TrivialClock 需求。
自从
build 327

在文件 timing.hpp96 行定义.

参考 yforward.

参考自 YSLib::UI::GSequenceViewer< ListType >::AdjustForContent() , 以及 average().

这是这个函数的调用关系图:

template<typename _fCallable , typename... _tParams>
double ytest::timing::total_c ( size_t  n,
_fCallable &&  f,
_tParams &&...  args 
)
inline

测试指定函数执行若干次的总时间。

注解
使用 std::clock() 计时。
自从
build 327

在文件 timing.hpp113 行定义.

参考 yforward.