Author: echatellier Date: 2012-02-10 18:27:06 +0100 (Fri, 10 Feb 2012) New Revision: 2796 Url: http://chorem.org/repositories/revision/jtimer/2796 Log: Add doc about time tracking algorithm Added: trunk/src/site/en/rst/devel/idledetection.rst Added: trunk/src/site/en/rst/devel/idledetection.rst =================================================================== --- trunk/src/site/en/rst/devel/idledetection.rst (rev 0) +++ trunk/src/site/en/rst/devel/idledetection.rst 2012-02-10 17:27:06 UTC (rev 2796) @@ -0,0 +1,27 @@ +Idle detection +============== + +System info +----------- + +jTimer use JNA to call system native code to get user idle time since it's +not possible in pure Java. + + +Time tracking on task +--------------------- + +The time tracking algorithm is mainly based on "start task timestamp" and +"current timestamp" comparison. This comparison is adjusted with user idle time. + +So the algorithm work as it: + * init start timestamp + * loop iteration each 1000 ms until user stop task + * try to detect hibernation (previous idle tracking > 5min) + * try to detect idle (user idle time = 5min) + * publish time to listener (UI) + * display idle resume dialog (block time tracking) + * remember idle time () + * resume task + * publish current time to listener (UI) + * mark task as stopped
participants (1)
-
echatellier@users.chorem.org