Welcome to mirror list, hosted at ThFree Co, Russian Federation.

timeit.cc « intern « blenlib « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2dcfe2e6ab1aecc7f03c1158e15e2a1c003133de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include "BLI_timeit.hh"

namespace blender::timeit {

void print_duration(Nanoseconds duration)
{
  if (duration < std::chrono::microseconds(100)) {
    std::cout << duration.count() << " ns";
  }
  else if (duration < std::chrono::seconds(5)) {
    std::cout << duration.count() / 1.0e6 << " ms";
  }
  else {
    std::cout << duration.count() / 1.0e9 << " s";
  }
}

}  // namespace blender::timeit