float elapsedTime;
...
void draw() {
if (0 < port.available()) {
elapsedTime = port.read();
}
println(elapsedTime);
}
First, I hate this style:
If 0 < the number of apples in the room ...
No-one talks like that.
Why not:
If the number of apples in the room is > 0 ...
Second, you are printing elapsedTime even if you haven't read it.