From 5dde1907d68521e2391d9234a2acbe0329d90d1c Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 27 Oct 2012 11:47:21 +0000 Subject: [PATCH] profiler --- libsrc/general/profiler.cpp | 9 +++++++++ libsrc/general/profiler.hpp | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libsrc/general/profiler.cpp b/libsrc/general/profiler.cpp index 91db4eff..06ea6934 100644 --- a/libsrc/general/profiler.cpp +++ b/libsrc/general/profiler.cpp @@ -114,5 +114,14 @@ namespace netgen } + void NgProfiler :: ClearTimers () + { + for (int i = 0; i < SIZE; i++) + { + tottimes[i] = 0; + counts[i] = 0; + } + } + NgProfiler prof; } diff --git a/libsrc/general/profiler.hpp b/libsrc/general/profiler.hpp index a3ad811c..c39a5fbc 100644 --- a/libsrc/general/profiler.hpp +++ b/libsrc/general/profiler.hpp @@ -35,7 +35,7 @@ public: NgProfiler(); ~NgProfiler(); static int CreateTimer (const string & name); - + static void StartTimer (int nr) { starttimes[nr] = clock(); counts[nr]++; @@ -51,6 +51,8 @@ public: //static void Print (ostream & ost); static void Print (FILE * prof); + static void ClearTimers (); + class RegionTimer { int nr;