for (int i = 0; i < 1000000; i++) {
ODocument document = new ODocument("SpeedTest");
document.save();
}
ORecordIteratorClass iterator = new ORecordIteratorClass(db, (ODatabaseRecordAbstract) db.getUnderlying(), "SpeedTest", true);
iterator.setRange(new ORecordId(oClass.getDefaultClusterId(), new OClusterPositionLong(999998)),
new ORecordId(oClass.getDefaultClusterId(), new OClusterPositionLong(999999)));
long start = System.nanoTime();
while (iterator.hasNext())
iterator.next();
long end = System.nanoTime();
System.out.println(end - start);
db.drop();