Update main.js

Time tracking function