Skip to content

Commit 087765f

Browse files
Better explain speed measurement in WebClient example
1 parent abda3d9 commit 087765f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/WebClient/WebClient.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ IPAddress myDns(192, 168, 0, 1);
3434
// that you want to connect to (port 80 is default for HTTP):
3535
EthernetClient client;
3636

37+
// Variables to measure the speed
3738
unsigned long beginMicros, endMicros;
38-
unsigned long byteCount=0;
39+
unsigned long byteCount = 0;
40+
bool printWebData = true; // set to false for better speed measurement
3941

4042
void setup() {
4143
// You can use Ethernet.init(pin) to configure the CS pin
@@ -93,7 +95,9 @@ void loop() {
9395
byte buffer[80];
9496
if (len > 80) len = 80;
9597
client.read(buffer, len);
96-
Serial.write(buffer, len); // show in the serial monitor (slows some boards)
98+
if (printWebData) {
99+
Serial.write(buffer, len); // show in the serial monitor (slows some boards)
100+
}
97101
byteCount = byteCount + len;
98102
}
99103

0 commit comments

Comments
 (0)