Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/src/Debug.cpp

25 lines
642 B
C++
Raw Normal View History

2016-05-09 14:05:08 +00:00
#include "Debug.h"
void Debug::print_microseconds_per_scan()
{
if (millis() >= nextTime)
{
Keyboard.print(1000000/scanCount); //print microseconds per scan
Keyboard.write(',');
scanCount = 0;
nextTime = millis() + 1000; //print every second
}
scanCount++;
}
void Debug::print_scans_per_second()
{
if (millis() >= nextTime)
{
Keyboard.print(scanCount); //print scans per second
Keyboard.write(',');
scanCount = 0;
nextTime = millis() + 1000; //print every second
}
scanCount++;
}