time measurement libraries courtesy of piotao