getAFKtime function building