blob: 2024a65d52f73ec7363afc14f7f104d95dae8939 [file] [log] [blame]
Austin Schuh1e69f942020-11-14 15:06:14 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2020 FIRST. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#include "frc/ScopedTracer.h"
9
10#include <wpi/raw_ostream.h>
11
12using namespace frc;
13
14ScopedTracer::ScopedTracer(wpi::Twine name, wpi::raw_ostream& os)
15 : m_name(name.str()), m_os(os) {
16 m_tracer.ResetTimer();
17}
18
19ScopedTracer::~ScopedTracer() {
20 m_tracer.AddEpoch(m_name);
21 m_tracer.PrintEpochs(m_os);
22}