Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 256007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:58:41+00:00 2026-05-11T21:58:41+00:00

I have quite an interesting task at work – I need to find out

  • 0

I have quite an interesting task at work – I need to find out how much time user spent doing something and all I have is timestamps of his savings. I know for a fact that user saves after each small portion of a work, so they is not far apart.

The obvious solution would be to find out how much time one small item could possibly take and then just go through sorted timestamps and if the difference between current one and previous one is more than that, it means user had a coffee break, and if it’s less, we can just add up this difference into total sum. Simple example code to illustrate that:

var prev_timestamp = null;
var total_time = 0;
foreach (timestamp in timestamps) {
    if (prev_timestamp != null) {
         var diff = timestamp - prev_timestamp;
         if (diff < threshold) {
              total_time += diff;
         }
    }
    prev_timestamp = timestamp;
}

The problem is, while I know about how much time is spent on one small portion, I don’t want to depend on it. What if some user just that much slower than my predictions, I don’t want him to be left without paycheck. So I was thinking, could there be some clever math solution to this problem, that could work without knowledge of what time interval is acceptable?

PS. Sorry for misunderstanding, of course no one would pay people based on this numbers and even if they would, they understand that it is just an approximation. But I’d like to find a solution that would emit numbers as close to real life as possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:58:41+00:00Added an answer on May 11, 2026 at 9:58 pm

    You need to either look at the standard deviation for the group of all users or the variance in the intervals for a single user or better a combination of the two for your sample set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started diving into Haskell. Its quite interesting, but the definition of
I have quite a large VB6 project, with many forms, classes, modules and user
We have quite a bit of reusable code at work (a good thing). Whenever
This is quite an interesting question so let me set the scene. I work
I have a quite big XML output from an application. I need to process
I have an interesting problem, however I don't know quite how to articulate it
I have ran into quite an interesting mapping scenario. I have two entities (
I recently came across the link below which I have found quite interesting. http://en.wikipedia.org/wiki/XOR_linked_list
This is a quite interesting question, in my opinion. I have a strongly typed
Lately I bumped repeatedly into the concept of LFSR, that I find quite interesting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.