Skip to content

Commit 41b8fc2

Browse files
FozzTexxtschak909
authored andcommitted
Print characters per second when finished sending file.
1 parent 98be22c commit 41b8fc2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/device/iec/drive.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ bool iecDrive::sendFile()
11261126
bool eoi = false;
11271127
uint32_t size = istream->size();
11281128
uint32_t avail = istream->available();
1129+
uint64_t t_start = esp_timer_get_time(), t_end;
11291130

11301131
//fnLedStrip.startRainbow(300);
11311132

@@ -1231,7 +1232,11 @@ bool iecDrive::sendFile()
12311232
}
12321233

12331234

1234-
Serial.printf("=================================\r\n%d bytes sent of %d [SYS%d]\r\n\r\n", count, size, sys_address);
1235+
t_end = esp_timer_get_time();
1236+
t_end -= t_start;
1237+
double seconds = t_end / 1000000.0;
1238+
double cps = count / seconds;
1239+
Serial.printf("=================================\r\n%d bytes sent of %d @ %0.2fcps[SYS%d]\r\n\r\n", count, size, cps, sys_address);
12351240

12361241
//Debug_printv("len[%d] avail[%d] success_rx[%d]", len, avail, success_rx);
12371242

0 commit comments

Comments
 (0)