Skip to main content
edited body
Source Link
001
  • 963
  • 6
  • 13

As mentioned in the comments, your main problem is you declare starttime as inan int. This is a signed value with a range of -32,768 to 32,767. You will quickly overflow - in about 32 seconds.

The solution is to use an unsigned long which has a range of 0 to 4,294,967,295.

As mentioned in the comments, your main problem is you declare starttime as in int. This is a signed value with a range of -32,768 to 32,767. You will quickly overflow - in about 32 seconds.

The solution is to use an unsigned long which has a range of 0 to 4,294,967,295.

As mentioned in the comments, your main problem is you declare starttime as an int. This is a signed value with a range of -32,768 to 32,767. You will quickly overflow - in about 32 seconds.

The solution is to use an unsigned long which has a range of 0 to 4,294,967,295.

Source Link
001
  • 963
  • 6
  • 13

As mentioned in the comments, your main problem is you declare starttime as in int. This is a signed value with a range of -32,768 to 32,767. You will quickly overflow - in about 32 seconds.

The solution is to use an unsigned long which has a range of 0 to 4,294,967,295.