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

polserver / polserver / 25918451630

15 May 2026 12:43PM UTC coverage: 60.929% (+2.1%) from 58.859%
25918451630

push

github

turleypol
added dynamic property which returns a pointer of the object instead of
a copy like the current imp.
needed to be able to eg store a vector

43 of 61 new or added lines in 2 files covered. (70.49%)

14455 existing lines in 345 files now uncovered.

44695 of 73356 relevant lines covered (60.93%)

449621.59 hits per line

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

68.57
/pol-core/clib/timer.cpp
1
#include "timer.h"
2

3
#include "logfacility.h"
4

5

6
namespace Pol::Tools
7
{
UNCOV
8
void DebugT::print( const std::string& name, long long time )
×
9
{
UNCOV
10
  INFO_PRINTLN(
×
11
      "\n----------------------------------\n"
12
      "{}: {} ms"
13
      "\n----------------------------------",
14
      name, time );
UNCOV
15
}
×
16
void SilentT::print( const std::string&, long long ) {}
3,003✔
17

18
template <class printer>
UNCOV
19
Timer<printer>::Timer( std::string name ) : _name( std::move( name ) )
×
20
{
UNCOV
21
  start();
×
22
}
×
23
template <class printer>
24
Timer<printer>::Timer() : _name( "" )
3,001✔
25
{
26
  start();
3,001✔
27
}
3,001✔
28
template <class printer>
29
Timer<printer>::~Timer()
3,003✔
30
{
31
  if ( _start == _end )
3,003✔
32
    stop();
334✔
33
  printer::print( _name, ellapsed() );
3,003✔
34
}
3,003✔
35
template <class printer>
36
void Timer<printer>::start()
3,001✔
37
{
38
  _start = _end = Clock::now();
3,001✔
39
}
3,001✔
40
template <class printer>
41
void Timer<printer>::stop()
3,003✔
42
{
43
  _end = Clock::now();
3,003✔
44
}
3,003✔
45

46
template <class printer>
47
long long Timer<printer>::ellapsed() const
3,050✔
48
{
49
  Clock::time_point _now = Clock::now();
3,050✔
50
  if ( _start != _end )  // already stopped
3,050✔
51
    _now = _end;
3,024✔
52
  return std::chrono::duration_cast<ms>( _now - _start ).count();
3,050✔
53
}
54
template <class printer>
UNCOV
55
double Timer<printer>::ellapsed_s() const
×
56
{
UNCOV
57
  return ellapsed() * static_cast<double>( ms::period::num ) / ms::period::den;
×
58
}
59
template <class printer>
UNCOV
60
void Timer<printer>::print() const
×
61
{
UNCOV
62
  DebugT::print( _name, ellapsed() );
×
63
}
×
64

65

66
HighPerfTimer::HighPerfTimer() : _start( Clock::now() ) {}
31,329,693✔
67

68
HighPerfTimer::time_mu HighPerfTimer::ellapsed() const
31,329,671✔
69
{
70
  Clock::time_point _now = Clock::now();
31,329,671✔
71
  return std::chrono::duration_cast<time_mu>( _now - _start );
31,329,671✔
72
}
73

74
// forward declarce both versions
75
template class Timer<DebugT>;
76
template class Timer<SilentT>;
77
}  // namespace Pol::Tools
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc