draw() framerate
in
Programming Questions
•
3 years ago
Hi,
I'm working on a program which is reading values from a csv file.
Basically the csv file looks like x, y, z.
I'm extracting the values x and y in a function i'm calling during setup() to fill Vectors (or arrays) in order to load these values in memory rather than reading them from hard drive.
That's my first question : Doest that make any sense in term of performance.
The file contains 256 entry, each entry contain x, y, z:
Where x is a time value in ms and y a voltage value.
x start at 0.0s and end at 1.0s.
So the exactly lenght of the recorded signal is 1 second.
Now my question is: how to read the file at the same rate so that each cycle is during exactly 1sec ?
It seems that processing run at 60fps if no frameRate function is called. 60fps means i can only read 60 values and each draw() loop run every 16,6ms. If i call frameRate(120) i can slow down it to 8,3ms. It's the higher rate which seems stable. So is there any solution to read 256 values from a file or an object in memory in one second ?
I may be confused myself a bit but any help is apprecied.
Regards,
S
I'm working on a program which is reading values from a csv file.
Basically the csv file looks like x, y, z.
I'm extracting the values x and y in a function i'm calling during setup() to fill Vectors (or arrays) in order to load these values in memory rather than reading them from hard drive.
That's my first question : Doest that make any sense in term of performance.
The file contains 256 entry, each entry contain x, y, z:
Where x is a time value in ms and y a voltage value.
x start at 0.0s and end at 1.0s.
So the exactly lenght of the recorded signal is 1 second.
Now my question is: how to read the file at the same rate so that each cycle is during exactly 1sec ?
It seems that processing run at 60fps if no frameRate function is called. 60fps means i can only read 60 values and each draw() loop run every 16,6ms. If i call frameRate(120) i can slow down it to 8,3ms. It's the higher rate which seems stable. So is there any solution to read 256 values from a file or an object in memory in one second ?
I may be confused myself a bit but any help is apprecied.
Regards,
S
1