Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Calculating durations should use a monotonic clock instead of system_clock

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
analytics

Research direction

No file or test is named. Start by locating duration calculations and distinguishing them from timestamp creation; done means durations use a monotonic clock while timestamps continue using system_clock, with coverage for clock changes if the existing tests support it.

Written by the indexing model from the issue text.

Description

Durations should not use the system_clock as this can change, resulting in "incorrect" durations (e.g. a user changing the system clock back an hour while an application is running in the background could result in a negative duration).

Instead, durations should be calculated using a monotonic clock (e.g. steady_clock)

However: timestamps need to continue to use system_clock as they need a known epoch time (steady_clock won't provide a known epoch - it ends up as time since the clock started)

Dominant language
C++
Stars
34
Forks
25
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Countly/countly-sdk-cpp

All issues in Countly/countly-sdk-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.