diff options
author | Arnur Nigmetov <a.nigmetov@gmail.com> | 2017-04-24 17:12:46 +0200 |
---|---|---|
committer | Arnur Nigmetov <a.nigmetov@gmail.com> | 2017-04-24 17:12:46 +0200 |
commit | ad723189c90c37ffdba34c2db5c764ceb2192086 (patch) | |
tree | 03b976b2c47812087534a4a18cb17a1f69c778b7 /geom_bottleneck/bottleneck/src/bound_match.cpp | |
parent | 24549c23156d612be2859583489f155bf8567008 (diff) |
Verbose timing for bottleneck added
Timing info is printed, if VERBOSE_BOTTLENECK is #defined in def_debug_bt.h.
Diffstat (limited to 'geom_bottleneck/bottleneck/src/bound_match.cpp')
-rw-r--r-- | geom_bottleneck/bottleneck/src/bound_match.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/geom_bottleneck/bottleneck/src/bound_match.cpp b/geom_bottleneck/bottleneck/src/bound_match.cpp index a9ec93a..a95ee60 100644 --- a/geom_bottleneck/bottleneck/src/bound_match.cpp +++ b/geom_bottleneck/bottleneck/src/bound_match.cpp @@ -21,6 +21,11 @@ along with GeomBottleneck. If not, see <http://www.gnu.org/licenses/>. #include <assert.h> #include "def_debug_bt.h" #include "bound_match.h" + +#ifdef VERBOSE_BOTTLENECK +#include <chrono> +#endif + #ifndef FOR_R_TDA #include <iostream> #endif @@ -245,7 +250,19 @@ BoundMatchOracle::BoundMatchOracle(DiagramPointSet psA, DiagramPointSet psB, bool BoundMatchOracle::isMatchLess(double r) { - return buildMatchingForThreshold(r); +#ifdef VERBOSE_BOTTLENECK + std::chrono::high_resolution_clock hrClock; + std::chrono::time_point<std::chrono::high_resolution_clock> startMoment; + startMoment = hrClock.now(); +#endif + bool result = buildMatchingForThreshold(r); +#ifdef VERBOSE_BOTTLENECK + auto endMoment = hrClock.now(); + std::chrono::duration<double, std::milli> iterTime = endMoment - startMoment; + std::cout << "isMatchLess for r = " << r << " finished in " << std::chrono::duration<double, std::milli>(iterTime).count() << " ms." << std::endl; +#endif + return result; + } |