add time function and environ