Blender V4.3
BLI_timeit.hh File Reference
#include <chrono>
#include <string>
#include "BLI_sys_types.h"

Go to the source code of this file.

Classes

class  blender::timeit::ScopedTimer
class  blender::timeit::ScopedTimerAveraged

Namespaces

namespace  blender
namespace  blender::timeit

Macros

#define SCOPED_TIMER(name)
#define SCOPED_TIMER_AVERAGED(name)

Typedefs

using blender::timeit::Clock = std::chrono::steady_clock
using blender::timeit::TimePoint = Clock::time_point
using blender::timeit::Nanoseconds = std::chrono::nanoseconds

Functions

void blender::timeit::print_duration (Nanoseconds duration)

Macro Definition Documentation

◆ SCOPED_TIMER

◆ SCOPED_TIMER_AVERAGED

#define SCOPED_TIMER_AVERAGED ( name)
Value:
static int64_t total_count_; \
static blender::timeit::Nanoseconds total_time_; \
static blender::timeit::Nanoseconds min_time_ = blender::timeit::Nanoseconds::max(); \
blender::timeit::ScopedTimerAveraged scoped_timer(name, total_count_, total_time_, min_time_)
std::chrono::nanoseconds Nanoseconds
Definition BLI_timeit.hh:16
__int64 int64_t
Definition stdint.h:89

Print the average and minimum runtime of the timer's scope.

Warning
This uses static variables, so it is not thread-safe.

Definition at line 67 of file BLI_timeit.hh.

Referenced by blender::bke::pbvh::build_mesh_leaf_nodes(), blender::bke::mesh::corner_split_generator(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), and blender::bke::mesh::normals_calc_corners().