CG Photography Coarse Art Other Stuff
CG Photography Coarse Art Other Stuff

This is a bash script I wrote to show how long each file in a list of files took to render. Since I currently have Mac OS X 10.5.3 installed, I know it works with that system--no guarantees about any others. To use it:
 
(1) Download this file, and put it in a directory defined in your $PATH variable (for example, /opt/local/bin/).
 
(2) In a terminal window, cd to the file's directory and change the file's permissions:
% cd /opt/local/bin/
% chmod 744 get_render_time
 
(3) Run the script with a list of files, where "~/home/of/files/*" is the location of the files:
% get_render_time ~/home/of/files/*

#!/bin/bash
# get_render_time
# Version 1.0
# Written by Tito Sciortino
# June 6, 2008
# This calculates the render time (hhhhh:mm:ss) for an image by
# subtracting the creation time from the modification time.
# Works in Mac OS X 10.5 since the files' inodes each have a
# "birth time" field.
# After updates to this file, copy into /opt/local/bin/, then do:
#   % chmod 744 get_render_time

for filename in "$@" ; do
    declare -i xc=$(stat -f %B $filename)
    declare -i xm=$(stat -f %m $filename)
    declare -i xe=$(( $xm - $xc ))
    printf "render time for %s: %04d:%02d:%02d\n" $filename $(( $xe/3600 )) $(( ($xe%3600)/60 )) $(( $xe%60 ))
done