time function inside chat