Raghwendra-Dey / productivity_meter

Productivity meter for measuring productivity of solving problems
https://raghwendra-dey.github.io/productivity_meter/
MIT License
13 stars 23 forks source link

Check if first timer is running or not before starting second #10

Closed rsriramc closed 3 years ago

rsriramc commented 3 years ago

Check if first timer (Time devoted) is running or not before starting second timer(Actual Time).

The issue #4 can be closed.

Raghwendra-Dey commented 3 years ago

Hey @ravisrc, Actually I didn't found any place where you put the timerInterval variable to 1. I think it should be done in the startTimer thing. Also since, now #9 has been merged, and it also uses a similar concept, i.e. to track the running status of the timers using a boolean variable. So, could you please modify your code a bit, and use that same variable watchRunning used in there, to serve this purpose as well? That would reduce retundency, and nothing else.

rsriramc commented 3 years ago

Hey @ravisrc, Actually I didn't found any place where you put the timerInterval variable to 1. I think it should be done in the startTimer thing. Also since, now #9 has been merged, and it also uses a similar concept, i.e. to track the running status of the timers using a boolean variable. So, could you please modify your code a bit, and use that same variable watchRunning used in there, to serve this purpose as well? That would reduce retundency, and nothing else.

Ok. I shall use the same variable. But, just for clarification, there is no need of changing the timerInterval to 1 because the function setInterval does that. It returns a unique ID representing the interval it has started. But, fine I shall use the same variable mentioned in #9