add spent hour function