• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 23529483807

25 Mar 2026 07:17AM UTC coverage: 48.515% (-1.6%) from 50.098%
23529483807

Pull #57

github

web-flow
Merge 5b1e117ad into 38f9f3616
Pull Request #57: feat(comparator): add pairwise traces comparator

18829 of 49412 branches covered (38.11%)

Branch coverage included in aggregate %.

1584 of 1933 new or added lines in 14 files covered. (81.95%)

3552 existing lines in 135 files now uncovered.

18474 of 27477 relevant lines covered (67.23%)

241072.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/dftracer/utils/core/utils/timer.cpp
1
#include <dftracer/utils/core/common/logging.h>
2
#include <dftracer/utils/core/utils/timer.h>
3

4
#include <cinttypes>
5
#include <cstdio>
6

7
namespace dftracer::utils {
8

9
Timer::Timer(bool autostart, bool verbose)
×
10
    : verbose_(verbose), running_(false) {
×
11
    if (autostart) {
×
12
        start();
×
UNCOV
13
    }
×
14
}
×
15

16
Timer::Timer(const std::string& name, bool autostart, bool verbose)
×
17
    : verbose_(verbose), running_(false), name_(name) {
×
18
    if (autostart) {
×
19
        start();
×
UNCOV
20
    }
×
21
}
×
22

23
Timer::~Timer() {
×
24
    stop();
×
25
    if (verbose_) {
×
26
        if (name_.empty()) {
×
27
            std::printf("Elapsed time: %" PRId64 " ns\n", elapsed());
×
UNCOV
28
        } else {
×
29
            std::printf("[%s] Elapsed time: %" PRId64 " ns\n", name_.c_str(),
×
UNCOV
30
                        elapsed());
×
31
        }
UNCOV
32
    }
×
33
}
×
34

35
void Timer::start() {
×
36
    start_time = Clock::now();
×
37
    running_ = true;
×
38
}
×
39

40
void Timer::stop() {
×
41
    if (running_) {
×
42
        end_time = Clock::now();
×
43
        running_ = false;
×
UNCOV
44
    }
×
45
}
×
46

47
std::int64_t Timer::elapsed() const {
×
48
    if (running_) {
×
49
        return std::chrono::duration_cast<std::chrono::nanoseconds>(
×
50
                   Clock::now() - start_time)
×
51
            .count();
×
52
    } else {
53
        return std::chrono::duration_cast<std::chrono::nanoseconds>(end_time -
×
54
                                                                    start_time)
×
55
            .count();
×
56
    }
UNCOV
57
}
×
58

59
}  // namespace dftracer::utils
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc