I need to update the time in my setInterval. The value is returned by the function that setInterval is executing.
read_log();
If you need to change the repetition interval after each call to read_log(), you can't use setInterval() -- that uses a constent repetition. You need to use setTimeout, so you can change the period each time:
function call_read_log() {
var count = read_log();
setTimeout(call_read_log, count);
}
call_read_log();