created time function in time.c