implemented simple time function