OpenTTD Source: TicToc::State Struct Reference

OpenTTD Source 15.3

Public Types | Public Member Functions | Static Public Member Functions | Data Fields
TicToc::State Struct Reference

Persistent state for TicToc profiling. More...

`#include <debug.h>`

## Public Types
using | States = std::vector< State * >

## Public Member Functions
| State (std::string_view name, std::optional< uint32_t > max_count={})
void | OutputAndReset (const std::string_view prefix="")

## Static Public Member Functions
static States & | GetStates ()

## Data Fields
const std::string_view | name
const std::optional< uint32_t > | max_count
uint32_t | count = 0
uint64_t | chrono_sum = 0

## Detailed Description

Persistent state for TicToc profiling.

Definition at line 76 of file debug.h.

## Member Typedef Documentation

## ◆ States

using TicToc::State::States = std::vector<State *>

Definition at line 82 of file debug.h.

## Constructor & Destructor Documentation

## ◆ State()

TicToc::State::State | ( | std::string_view | name,
|  | std::optional< uint32_t > | max_count = `{}`
| ) |  |
| inline

Definition at line 84 of file debug.h.

## ◆ ~State()

TicToc::State::~State | ( |  | ) |
| inline

Definition at line 89 of file debug.h.

## Member Function Documentation

## ◆ GetStates()

static States & TicToc::State::GetStates | ( |  | ) |
| inlinestatic

Definition at line 95 of file debug.h.

## ◆ OutputAndReset()

void TicToc::State::OutputAndReset | ( | const std::string_view | prefix = `""` | ) |
| inline

Definition at line 101 of file debug.h.

## Field Documentation

## ◆ chrono_sum

uint64_t TicToc::State::chrono_sum = 0

Definition at line 80 of file debug.h.

## ◆ count

uint32_t TicToc::State::count = 0

Definition at line 79 of file debug.h.

## ◆ max_count

const std::optional<uint32_t> TicToc::State::max_count

Definition at line 78 of file debug.h.

## ◆ name

const std::string_view TicToc::State::name

Definition at line 77 of file debug.h.

The documentation for this struct was generated from the following file:

- src/debug.h