Ignore:
Timestamp:
Apr 2, 2011, 12:20:10 AM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
bbd746
Parents:
93abe8
git-author:
Frederik Heber <heber@…> (03/15/11 09:53:34)
git-committer:
Frederik Heber <heber@…> (04/02/11 00:20:10)
Message:

Chronos is so far fully working.

  • Library version is now 7:0:0, API version is 1.1.0.
  • using either time.h or sys/times.h if present to measure timing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Helpers/Chronos.hpp

    r93abe8 r8e24ef  
    2626  //!> unit tests needs access to private members
    2727  friend class ChronosTest;
     28  //!> operator needs to access some internals
     29  friend std::ostream& operator<<(std::ostream &ost, const Chronos &_time);
    2830public :
    2931
     
    3335   * @return current amount of time passed for this function, 0 if unknown, -1 if currently running
    3436   */
    35   int getTime(const std::string _name) const;
     37  double getTime(const std::string _name) const;
    3638
    3739  /** Resets time counter for this function \a _name to zero.
     
    5557  /** Sums up total time accounted for.
    5658   *
    57    * @return total time
     59   * @return total time in seconds
    5860   */
    59   int SumUpTotalTime() const;
     61  double SumUpTotalTime() const;
    6062
    6163  /** Sums up all functions accounted.
     
    7274
    7375private:
     76  /** Returns the current timer in seconds.
     77   *
     78   * This function is present to allow for changing of time measurements
     79   * without the other functions noticing.
     80   *
     81   * \note We convert clock() by CLOCKS_PER_SEC.
     82   *
     83   * @return current time in unit of seconds
     84   */
     85  double getCurrentTime() const;
    7486
    75   typedef std::map<const std::string, int> TimekeepingMap;
    76   typedef std::map<const std::string, bool> TimerStatusMap;
     87
     88  typedef std::map<const std::string, double> TimekeepingMap;
     89  typedef std::map<const std::string, double> TimerStatusMap;
    7790
    7891  TimekeepingMap AccountedTime;
    79   TimerStatusMap IsTimeRunning;
     92  TimerStatusMap TimeRunning;
    8093};
    8194
Note: See TracChangeset for help on using the changeset viewer.