from time import time from sys import argv x = bytearray(int(argv[1])) t = time() x2 = bytearray(len(x)) x2[:] = x print time() - t