It will be tough. You can probably implement some code that will track the time between when a page is shown and when the user clicks a button or link on that page. You won't be able to measure how much of that time the user spent actually looking at the page versus getting a cup of
coffee, answering a phone call or the such. Also what if the user never clicks on a link or button?
I know that there are third party products that try and produce these types of metrics. If you needs are sophisticated I would suggest you purchase such a product. If you need something very simple then your general approach seems good (though using a database seems better than a log file).
- Brent