Cycles: Report total and render time to the log
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 17 Jun 2015 09:56:19 +0000 (11:56 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 17 Jun 2015 12:07:51 +0000 (14:07 +0200)
This includes total render time spent on rendering since render() was
invoked and also prints time of actual rendering (without synchronization
step).

intern/cycles/blender/blender_session.cpp
intern/cycles/util/util_progress.h

index bc1fd37962e17d872e7c8d5dafec87413b8d372f..b82289e007b2a306925d7f0259731f8a004b55ff 100644 (file)
@@ -32,6 +32,7 @@
 #include "util_color.h"
 #include "util_foreach.h"
 #include "util_function.h"
+#include "util_logging.h"
 #include "util_progress.h"
 #include "util_time.h"
 
@@ -502,6 +503,11 @@ void BlenderSession::render()
                        break;
        }
 
+       double total_time, render_time;
+       session->progress.get_time(total_time, render_time);
+       VLOG(1) << "Total render time: " << total_time;
+       VLOG(1) << "Render time (without synchronization): " << render_time;
+
        /* clear callback */
        session->write_render_tile_cb = function_null;
        session->update_render_tile_cb = function_null;
index 13fce655734c142e9784f40f84d4f8417ad61b13..0b35142ddb36d9a29250b32a71f538387b9d0c4b 100644 (file)
@@ -173,6 +173,12 @@ public:
                tile_time_ = tile_time;
        }
 
+       void get_time(double& total_time_, double& render_time_)
+       {
+               total_time_ = (total_time > 0.0)? total_time: 0.0;
+               render_time_ = (render_time > 0.0)? render_time: 0.0;
+       }
+
        void reset_sample()
        {
                thread_scoped_lock lock(progress_mutex);