Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tic.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*-
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2012-03-20
7 
8  Copyright (C) 2012 Université Joseph Fourier (Grenoble I)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #if !defined(FEELPP_TIMING_TIC_HPP)
30 #define FEELPP_TIMING_TIC_HPP 1
31 
33 #include <feel/feeltiming/now.hpp>
34 
35 namespace Feel
36 {
37 namespace details
38 {
39 struct SecondBasedTimer
40 {
41  static void print( std::string const& msg, const double& val )
42  {
43  if ( !msg.empty() )
44  std::cout << "[" << msg << "] Time : " << val << "s\n";
45  else
46  std::cout << "Time : " << val << "s\n";
47  }
48  static inline double time()
49  {
50  return Feel::details::now();
51  }
52 };
53 
54 counter<double,SecondBasedTimer> const sec_timer = {};
55 } // details
56 } // Feel
57 
58 namespace Feel
59 {
60 namespace time
61 {
62 inline void tic()
63 {
64  Feel::details::sec_timer.tic();
65 }
66 
67 inline double toc( std::string const& msg = "", bool display = true )
68 {
69  return Feel::details::sec_timer.toc( msg, display );
70 }
71 } // time
72 } // Feel
73 
74 namespace Feel
75 {
76 // Convenience namespace injection from time:: into Feel::
77 using time::tic;
78 using time::toc;
79 }
80 
81 #endif /* FEELPP_TIMING_TIC_HPP */
Expr< Val< typename mpl::if_< boost::is_arithmetic< ExprT1 >, mpl::identity< Cst< ExprT1 > >, mpl::identity< ExprT1 > >::type::type > > val(ExprT1 const &__e1)
precompute expression tensor
Definition: val.hpp:304

Generated on Sun Dec 22 2013 13:11:15 for Feel++ by doxygen 1.8.5