improved time complexity measuring