{"action":"created","issue":{"url":"https://api.github.com/repos/walmik/timer.jquery/issues/73","repository_url":"https://api.github.com/repos/walmik/timer.jquery","labels_url":"https://api.github.com/repos/walmik/timer.jquery/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/walmik/timer.jquery/issues/73/comments","events_url":"https://api.github.com/repos/walmik/timer.jquery/issues/73/events","html_url":"https://github.com/walmik/timer.jquery/issues/73","id":169798726,"number":73,"title":"Pause functionality not working for all timers","user":{"login":"wgpalexander","id":18104924,"avatar_url":"https://avatars.githubusercontent.com/u/18104924?v=3","gravatar_id":"","url":"https://api.github.com/users/wgpalexander","html_url":"https://github.com/wgpalexander","followers_url":"https://api.github.com/users/wgpalexander/followers","following_url":"https://api.github.com/users/wgpalexander/following{/other_user}","gists_url":"https://api.github.com/users/wgpalexander/gists{/gist_id}","starred_url":"https://api.github.com/users/wgpalexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wgpalexander/subscriptions","organizations_url":"https://api.github.com/users/wgpalexander/orgs","repos_url":"https://api.github.com/users/wgpalexander/repos","events_url":"https://api.github.com/users/wgpalexander/events{/privacy}","received_events_url":"https://api.github.com/users/wgpalexander/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-07T14:25:24Z","updated_at":"2016-08-07T20:15:18Z","closed_at":null,"body":"Hi guys,\r\n\r\nFirstly - great script, I'm using it within PhoneGap to create my first basic test app and it's proving very useful.\r\n\r\nI am creating a simple timer on one screen where we have 3 simultaneous timers:\r\n\r\n1) Elapsed - counts up to a set interval duration (e.g. 20s first, then 10s, then 30s)\r\n2) TotalTime - counts up, will cover multiple intervals (e.g. 1 min in this simple case)\r\n3) Remaining - is a countdown timer from the total of all intervals (e.g. 1 min in this simple case)\r\n\r\nLets ignore the complexities around refreshing the Elapsed timer for each interval and getting the total time for the countdown for the moment. \r\n\r\nI start all timers simultaneously using $('#Go').click - assuming this is all I do the counters work well.\r\n\r\nI have a pause button triggered by $('#Pause').click which then pauses all the timers at whatever reading they were on using the following code:\r\n\r\n$('#Pause').click(function() {\r\n  // Now need to pause the timers\r\n  $('#Elapsed').timer('pause');\r\n  $('#TotalTime').timer('pause');\r\n  $('#Remaining').timer('pause');\r\n+ some other unrelated code\r\n}); // End Pause click\r\n\r\nWhen I resume the timers however Elapsed seems to work as intended, but the other two timers jump out of sync - e.g. I have a demo running in the background just now which is meant to last 30s but TotalTime is 6:55 and Remaining is -7:25.\r\n\r\nI tried flashing an alert when paused to confirm the state of the timers and they all do return \"paused\" as I would expect so I think I'm implementing it properly.\r\n\r\nI noted that there was a closed case for a similar issue which you corrected with the latest version - I tried replacing the script with that one but the problem persisted (and actually created a new one whereby there is a slight delay starting the timers which knocks some other stuff out.)\r\n\r\nWould you be able to advise whether this is a script issue or a user issue? Would be great to get this resolved as I can finally close off that piece of my app :)\r\n\r\nMany thanks\r\nWayne "},"comment":{"url":"https://api.github.com/repos/walmik/timer.jquery/issues/comments/238105607","html_url":"https://github.com/walmik/timer.jquery/issues/73#issuecomment-238105607","issue_url":"https://api.github.com/repos/walmik/timer.jquery/issues/73","id":238105607,"user":{"login":"wgpalexander","id":18104924,"avatar_url":"https://avatars.githubusercontent.com/u/18104924?v=3","gravatar_id":"","url":"https://api.github.com/users/wgpalexander","html_url":"https://github.com/wgpalexander","followers_url":"https://api.github.com/users/wgpalexander/followers","following_url":"https://api.github.com/users/wgpalexander/following{/other_user}","gists_url":"https://api.github.com/users/wgpalexander/gists{/gist_id}","starred_url":"https://api.github.com/users/wgpalexander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wgpalexander/subscriptions","organizations_url":"https://api.github.com/users/wgpalexander/orgs","repos_url":"https://api.github.com/users/wgpalexander/repos","events_url":"https://api.github.com/users/wgpalexander/events{/privacy}","received_events_url":"https://api.github.com/users/wgpalexander/received_events","type":"User","site_admin":false},"created_at":"2016-08-07T20:15:18Z","updated_at":"2016-08-07T20:15:18Z","body":"Hi walmik - thanks for the prompt response.\r\n\r\nIn summary - I am looking to time a series of workout intervals, the sum of which is a total workout. I want to show the user \r\n\r\n1) the time ELAPSED in the specific interval; \r\n2) the TOTAL TIME that they have been working out for (e.g. could be several intervals)\r\n3) the total REMAINING time left in the workout (could be the sum of a number of intervals again)\r\n\r\nConsider this example - \r\n\r\nI want to do as many chin ups as I can in 3 minutes, then rest for 1 minute before another session of 3 minutes work. That is 3 intervals. \r\n\r\nREMAINING would be set to 7 mins (3+1+3) and would count down to 4 mins over the first interval. \r\nELAPSED and through TOTAL TIME would simultaneously count up to 3 mins\r\n\r\nAfter 3 minutes I have coded that the ELAPSED timer is removed & replaced with another ELAPSED timer with the new interval (all this works already so no worries here) and the next interval of 1 minute counts up without intervention.\r\nTOTAL TIME continues to count seamlessly so will head towards 4 minutes\r\nREMAINING continues to count down seamlessly so will head towards 3 minutes remaining (the final interval)\r\n\r\nAgain for the final interval the ELAPSED counter is removed & replaced with another 3 minute one which starts counting up immediately\r\nTOTAL TIME will continue to count up seamlessly towards 7 minutes\r\nREMAINING will continue to seamlessly count down to 0\r\n\r\nWhile hopefully this background helps, the issue seems to be with the pause mechanics within the script. When I run my app without pausing all the timers count up/down as required and work perfectly. When I pause & then resume they seem to go out of sync.\r\n\r\nI'm not using setInterval.\r\n\r\nThanks again!"}}
{"actor":{"display_login":"wgpalexander"}}