Ignore:
Timestamp:
Jul 14, 2014, 8:37:03 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Children:
ef9dff6
Parents:
e93bfe
git-author:
Frederik Heber <heber@…> (06/18/14 08:14:25)
git-committer:
Frederik Heber <heber@…> (07/14/14 20:37:03)
Message:

FIX: Chronos is now working correctly, no more negative times.

  • extracted difference calculator into static function, making it thus accessible to unit testing.
  • kudos to Saskia Metzler for inspiring the test.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodePatterns/Chronos.hpp

    re93bfe rca940b  
    9595  double getCurrentTime() const;
    9696
     97  typedef std::pair<size_t, size_t> sec_ncsec_t;
     98
     99  /** Returns the correct difference between split tuples (sec, nsec).
     100   *
     101   * \param _time1 first tuple
     102   * \param _time2 second tuple
     103   */
     104  static
     105  double calculateCorrectTimeDifference(
     106                const sec_ncsec_t &_time1,
     107      const sec_ncsec_t &_time2);
     108
    97109  //!> typedef for the map storing status of time keeping per token
    98110  typedef std::map<const std::string, double> TimerMap;
Note: See TracChangeset for help on using the changeset viewer.