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_fill_ceiling.py

26 lines
698 B
Python

from benchmarks import bench_temp_level
from mceditlib.selection import BoundingBox
from mceditlib.util import exhaust
import logging
logging.basicConfig(level=logging.INFO)
size = 50
def timeFillCeiling():
temp = bench_temp_level("AnvilWorld")
editor = temp
dim = editor.getDimension()
bounds = dim.bounds
x, y, z = bounds.center
y = 254
x -= size//2
z -= size//2
bounds = BoundingBox((x, y, z), (size, 1, size))
exhaust(dim.fillBlocksIter(bounds, editor.blocktypes["planks"]))
if __name__ == "__main__":
import timeit
time = timeit.timeit(timeFillCeiling, number=1)
print "Filled in %.02f (%0.3f per block" % (time, (time / (size * size)))