source: XIOS3/trunk/src/timer.hpp @ 2433

Last change on this file since 2433 was 2399, checked in by ymipsl, 21 months ago

-Fix performance issue in one_sided protocol

  • better timer instrumentation of the protocol

YM

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 854 bytes
RevLine 
[688]1#ifndef __XIOS_TIMER_HPP__
2#define __XIOS_TIMER_HPP__
[347]3
4#include <string>
5#include <map>
6
7namespace xios
8{
9  class CTimer
10  {
[652]11    public:
12      double cumulatedTime;
13      double lastTime;
14      bool suspended;
[1750]15      bool isTracing_ ;
[652]16      std::string name;
[688]17
[1750]18      CTimer(const std::string& name, bool trace=true);
[652]19      void suspend(void);
20      void resume(void);
21      void reset(void);
[2399]22      void add(double time) { cumulatedTime+=time ;}
23      void minus(double time) { cumulatedTime-=time ;}
[652]24      double getCumulatedTime(void);
25      static std::map<std::string,CTimer> allTimer;
26      static double getTime(void);
[1750]27      static CTimer& get(std::string name, bool trace=true);
[1158]28      static std::string getAllCumulatedTime(void) ;
[2274]29      static void release(void) { allTimer.clear() ;}
[2399]30      bool isSuspended() { return suspended; }
[652]31  };
[347]32}
33
34
35
36#endif
Note: See TracBrowser for help on using the repository browser.