Setting Sample_rate with pylink and EyeLink 1000

How can I specify the amount of samples I need using pylink?

Currently I specify tk.sendCommand(‘sample_rate 250’) when calling a calibration procedure. The rate is being changed (can be seen in EyeLink itself), however when I receive a sample tk.getNewestSample().getRightEye().getPupilSize() the length of array becomes 5000+ within 5 seconds or even worse 60000+ within 1 second if used in internal while loop (so basically every time the loop is executed).

How can I ensure that there is a specified number of samples being stored in an array?