NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
nativeSensorPortStub.setISensorPort(0, soundSensorStub);
NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
nativeSensorPort.setBehaviour(nativeSensorPortStub);
SoundSensor soundSensor = new SoundSensor(SensorPort.S1);
int sensorValue;
for (int i = 1; i <= anzahlMessungen; i++) {
long startTime = System.currentTimeMillis();
sensorValue = soundSensor.readValue();
System.out.println("Messung Nr. " + i + "\tergab Lautst�rke von "
+ sensorValue + "% " + "\t(Messdauer: "
+ (System.currentTimeMillis() - startTime) + "ms)");
}
}