FScopedSwitchedDurationTimer

Utility stopwatch class for tracking the duration of some action (tracks time in seconds and adds it to the specified variable on destruction).

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FScopedSwitchedDurationTimer

FScopedSwitchedCountedDurationTimer

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/ProfilingDebugging/ScopedTimers.h

Include

#include "ProfilingDebugging/ScopedTimers.h"

Syntax

class FScopedSwitchedDurationTimer

Remarks

Utility stopwatch class for tracking the duration of some action (tracks time in seconds and adds it to the specified variable on destruction). useful for timing that only wants to occur when a feature is optionally turned on

Variables

Name Description

Protected variable

double &

 

Accumulator

Time variable to update.

Protected variable

const bool

 

bDoFunctionality

Protected variable

double

 

StartTime

Start time, captured in ctor.

Constructors

Name Description

Public function

FScopedSwitchedDurationTimer

(
    double& AccumulatorIn,
    bool bDoFunctionalityIn
)

Destructors

Functions

Name Description

Public function

double

 

Start()