Use seconds+microseconds instead of pticks.
Use emalloc.