Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 3:673862dea889, committed 2019-01-18
- Comitter:
- ViriJay
- Date:
- Fri Jan 18 13:24:59 2019 +0000
- Parent:
- 2:8dc7ee41e9a7
- Commit message:
- timer
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Jan 18 10:52:31 2019 +0000
+++ b/main.cpp Fri Jan 18 13:24:59 2019 +0000
@@ -12,6 +12,8 @@
int txDataCnt = 0;
int rxDataCnt = 0;
+bool transmitter = true;
+
bool ackknowledged = true;
void init() {
@@ -76,18 +78,27 @@
}
void startTest() {
+ std::chrono::time_point<std::chrono::system_clock> start, end;
// start timer
+ start = std::chrono::system_clock::now();
// loop { send getal
// wacht op ack }
// send FIN
// wacht op FIN ACK
// stop timer
+ end = std::chrono::system_clock::now();
+ std::chrono::duration<double> duration = end - start;
+ std::cout << "Test duration: " << duration.count() << " seconds\n";
}
int main() {
- cs = 1;
init();
- bootup();
+
+ if (transmitter) {
+ startTest();
+ } else {
+ //listen ofzo
+ }
while (true) {
readButton();