Time and Space Complexity from Code