Guest User

Untitled

a guest
Dec 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. void foo( const int i )
  4. {
  5. std::cout << ( i + i ) << std::endl;
  6. }
  7.  
  8. int bar( const double d )
  9. {
  10. const int ret = static_cast< int >( d + 0.7 );
  11. std::cout << ( ret ) << std::endl;
  12. return ret;
  13. }
  14.  
  15. template< class Ret,
  16. class Callable,
  17. class ...Args >
  18. Ret callAnyProducer( Callable callable, Args&&... args )
  19. {
  20. // auto start = current_time_point();
  21. Ret ret = callable( std::forward( args... ) );
  22. // auto duration = start - current_time_point()
  23. return ret;
  24. }
  25.  
  26. int main()
  27. {
  28. //getExecutionTime( foo, 1 );
  29.  
  30. auto a = getExecutionTime( bar, 3.2 );
  31. return 0;
  32. }
Add Comment
Please, Sign In to add comment