I'm interested in how long my machine spends compiling scala in an average workday. Is there some way to log the total runtime of the scalac command every time it is run, even if it is run by some other tool such as sbt?
I was thinking about just renaming /usr/bin/scalac to /usr/bin/scalac_raw and writing a new /usr/bin/scalac that's just a bash script that runs scalac_raw (passing through all command-line parameters) and then logs its run time somewhere.
Is that a reasonable approach? If so, how might I write such a script? If not, any other ideas?