This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
mcedit2/benchmarks/mceditlib/time_exportimport.py

29 lines
683 B
Python

from mceditlib.export import extractSchematicFrom
from templevel import TempLevel
level = TempLevel("AnvilWorld")
schem = None
def timeExport():
global schem
schem = extractSchematicFrom(level, level.bounds)
def timeImport():
level.getDimension().copyBlocks(schem, schem.bounds, (0, 0, 0))
#
#import zlib
#import regionfile
#
#compresslevel = 1
#def _deflate(data):
# return zlib.compress(data, compresslevel)
#
#regionfile.deflate = _deflate
if __name__ == "__main__":
import timeit
#timeExport()
#timeImport()
print "Exported in %.02f" % (timeit.timeit(timeExport, number=1))
print "Imported in %.02f" % (timeit.timeit(timeImport, number=1))