Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2017-02-25 08:18:32 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2017-02-25 09:08:42 +0300
commita0b8a9fe6816f1e704b2edbeccddf1e3285e4520 (patch)
tree0a37aa6305f2fed08bdb960e763a0c7630cc0900 /source/blender/alembic/intern/abc_util.cc
parent8c5826f59a37924866ed7dd5bda7fb39c44e8227 (diff)
Alembic: addition of a scope timer to perform basic profiling.
Diffstat (limited to 'source/blender/alembic/intern/abc_util.cc')
-rw-r--r--source/blender/alembic/intern/abc_util.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc
index 08c94f437e6..158ec263df5 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -37,6 +37,8 @@ extern "C" {
#include "DNA_object_types.h"
#include "BLI_math.h"
+
+#include "PIL_time.h"
}
std::string get_id_name(Object *ob)
@@ -523,3 +525,15 @@ AbcObjectReader *create_reader(const Alembic::AbcGeom::IObject &object, ImportSe
return reader;
}
+
+/* ********************** */
+
+ScopeTimer::ScopeTimer(const char *message)
+ : m_message(message)
+ , m_start(PIL_check_seconds_timer())
+{}
+
+ScopeTimer::~ScopeTimer()
+{
+ std::fprintf(stderr, "%s: %fs\n", m_message, PIL_check_seconds_timer() - m_start);
+}