Fix for timing print in renders.

The time it was printing was excluding the time spent on color and file saving.
Now it includes this too, plus it prints the time spent on color/files.

Makes quite a difference when you do sequencer conversions or grading in 
terminals - time that was printed was very misleading.

For readablity of logs, also added an extra empty line after this print.
This commit is contained in:
Ton Roosendaal
2013-03-27 10:05:31 +00:00
parent da4401587c
commit 93d5e106aa

View File

@@ -2270,6 +2270,7 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
char name[FILE_MAX];
RenderResult rres;
Object *camera = RE_GetCamera(re);
double render_time;
int ok = 1;
RE_AcquireResultImage(re, &rres);
@@ -2353,11 +2354,17 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
RE_ReleaseResultImage(re);
render_time = re->i.lastframetime;
re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
BLI_timestr(re->i.lastframetime, name);
printf(" Time: %s", name);
BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS);
BLI_timestr(re->i.lastframetime - render_time, name);
printf(" (Saving: %s)\n", name);
fputc('\n', stdout);
fflush(stdout); /* needed for renderd !! (not anymore... (ton)) */