Inaccurate

You are basing your math from the sleep timer. However you’re forgetting that the snmpget can take longer than 0 seconds, which means that when the second trafbyteOut check runs, it has not been 0 seconds since the sleep of 1 second.

What you’ll want to do is get the current times and compare the two.