add time used code
add auto rotate code