math - How to calculate time span from timestamps? -


I have a very interesting job at work - I have to figure out how much time the user is spending and I have everything The timestamp of my savings I know of a fact that the user saves after every small part of the work, so they are not far away.

The obvious solution will be to find out how long a small object can take and then simply go through the sorted timestamp and if the difference between the existing one and the last one is greater than that, its This means that the user has a coffee break, and if it is less then we can add this difference to the total amount. Simple example to illustrate this:

  var prev_timestamp = null; Var total_time = 0; Forex currency (Timestamp in timestamp) {If (prev_timestamp! = Null) {var diff = Timestamp - prev_timestamp; If (difference> threshold) {total_time + = diff; }} Prev_timestamp = Timestamp; }  

The problem is, while I know how much time is spent on a small part, I do not want to depend on it. What if some users are too slow compared to my predictions, I do not want them to be left without paycheck, I was wondering if there could be some crafty mathematical solutions to this problem, which would be the interval of time Can the acceptable work?

Sorry for the PS misconception, of course, that no one will pay people on the basis of this number and even if they do, they think that this is just an estimate. But I would like to find a solution that can be used to get numbers closer to real life as much as possible.

You can either set a snap to a group of all users or for a single user or set your sample To look at the combination of two.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -