How about using diff function to your time vector data? The following is an example. The details need to be modified.
% time_vec: time stamp in order when RPM value changed.
% val_vec: RPM values at time_vec
d_time = diff(time_vec);
total_duration = sum(d_time);
percentage = 100 * sum(d_time(val_vec < 1)) / total_duration;
if time_vec does not include the time of your targeted start-time and end-time, you need to insert them to time_vec as well as the corresponding values to val_vec.
hope this helps.