#!/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