5152535455565758596061
engine.addEntity(entity); entities.add(entity); } System.out.println("Entities added time: " + timer.stop("entities") + "ms"); /** Removing components */ timer.start("componentRemoved"); for(Entity e:entities){
6061626364656667686970
for(Entity e:entities){ e.remove(PositionComponent.class); } System.out.println("Component removed time: " + timer.stop("componentRemoved") + "ms"); /** Adding components */ timer.start("componentAdded"); for(Entity e:entities){
6970717273747576777879
for(Entity e:entities){ e.add(new PositionComponent(0, 0)); } System.out.println("Component added time: " + timer.stop("componentAdded") + "ms"); /** System processing */ timer.start("systemProcessing"); engine.update(0);
7677787980818283848586
/** System processing */ timer.start("systemProcessing"); engine.update(0); System.out.println("System processing times " + timer.stop("systemProcessing") + "ms"); /** Removing entities */ timer.start("entitiesRemoved"); engine.removeAllEntities();
8384858687888990
/** Removing entities */ timer.start("entitiesRemoved"); engine.removeAllEntities(); System.out.println("Entity removed time: " + timer.stop("entitiesRemoved") + "ms"); } }