Use the time library, better documentation, and other improvements.