update_histogram with timing of a function

except timer:tc/1 doesn't exist in R14, so we can't use it, unfortunately.