Implemented cpu time taking via getrusage.