Dave Troxel
Posts: 0
Joined: Fri May 09, 2014 1:07 pm

Need stopwatch with lapse/timestamp capture at multiple intervals. No clue.

I have need of a stopwatch function with start and stop buttons as well as buttons in between to capture (timestamp) lapse time. Thus, after it is started, from say 00:00 (mm:ss) then the first timestamp button is pushed at say 01:14 it posts that in my UI, then a second timestamp button pushed at say 07:56 it posts that into the UI. Finally, when I hit the STOP button, it will post that final time (ex: 10:34). I don't know where to find such a script or how to invoke it. Any help would be greatly appreciated.

Dave Troxel
Posts: 0
Joined: Fri May 09, 2014 1:07 pm

Need stopwatch with lapse/timestamp capture at multiple intervals. No clue.

Oh yeah, one other thing, each time it timestamps or completes, I need it to populate specific fields in my DB. I think I have that mapped and working already unless I need to change the format of the field from text to number or time.. please advise. I am just this segment of coding away from finishing my project.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Need stopwatch with lapse/timestamp capture at multiple intervals. No clue.

Hello!

Please check Stopwatch example here, multiple intervals you can implement the same way https://getsatisfaction.com/apperyio/...

Dave Troxel
Posts: 0
Joined: Fri May 09, 2014 1:07 pm

Need stopwatch with lapse/timestamp capture at multiple intervals. No clue.

Under my projects tab, I created a new javascript and pasted in:

Coding: var sec = 0;
var min = 0;
var hour = 0;
function stopwatch() {
sec++;
if (sec == 60) {
sec = 0;
min = min + 1; }
else {
min = min; }
if (min == 60) {
min = 0;
hour += 1; }

if (sec, 1000);
}

I had to remove 'Coding:' as the script handler didn't seem to like it. That left me with:

var sec = 0;
var min = 0;
var hour = 0;
function stopwatch() {
sec++;
if (sec == 60) {
sec = 0;
min = min + 1; }
else {
min = min; }
if (min == 60) {
min = 0;
hour += 1; }

if (sec, 1000);
}

I simply haven't a clue what to do with it now. I can attach it to a button to start.. but where and how can I view it running? How do I get it in a label? How do I capture timestamps without stopping it and how do I get it to stop when I am ready? Really lost here. Thanks for all you can do to assist me.

Dave Troxel
Posts: 0
Joined: Fri May 09, 2014 1:07 pm

Need stopwatch with lapse/timestamp capture at multiple intervals. No clue.

Under my projects tab, I created a new javascript and pasted in:

Coding: var sec = 0;
var min = 0;
var hour = 0;
function stopwatch() {
sec++;
if (sec == 60) {
sec = 0;
min = min + 1; }
else {
min = min; }
if (min == 60) {
min = 0;
hour += 1; }

if (sec, 1000);
}

I had to remove 'Coding:' as the script handler didn't seem to like it. That left me with:

var sec = 0;
var min = 0;
var hour = 0;
function stopwatch() {
sec++;
if (sec == 60) {
sec = 0;
min = min + 1; }
else {
min = min; }
if (min == 60) {
min = 0;
hour += 1; }

if (sec, 1000);
}

I simply haven't a clue what to do with it now. I can attach it to a button to start.. but where and how can I view it running? How do I get it in a label? How do I capture timestamps without stopping it and how do I get it to stop when I am ready? Really lost here. Thanks for all you can do to assist me

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Need stopwatch with lapse/timestamp capture at multiple intervals. No clue.

Hi Dave,

You use an incorrect code. Please find an example here: http://stackoverflow.com/questions/20...

Return to “Issues”