mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpilibc] Output Tracer to DriverStation by default (#2469)
This matches the Java behavior. Also optimizes Java to only create a StringBuffer and call DriverStation.reportWarning if there is data to output.
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/StringRef.h>
|
||||
|
||||
namespace wpi {
|
||||
class raw_ostream;
|
||||
} // namespace wpi
|
||||
|
||||
namespace frc {
|
||||
/**
|
||||
* A class for keeping track of how much time it takes for different parts of
|
||||
@@ -51,10 +55,17 @@ class Tracer {
|
||||
void AddEpoch(wpi::StringRef epochName);
|
||||
|
||||
/**
|
||||
* Prints list of epochs added so far and their times.
|
||||
* Prints list of epochs added so far and their times to the DriverStation.
|
||||
*/
|
||||
void PrintEpochs();
|
||||
|
||||
/**
|
||||
* Prints list of epochs added so far and their times to a stream.
|
||||
*
|
||||
* @param os output stream
|
||||
*/
|
||||
void PrintEpochs(wpi::raw_ostream& os);
|
||||
|
||||
private:
|
||||
static constexpr std::chrono::milliseconds kMinPrintPeriod{1000};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user