Added get time function