So timezoneCorrection is probably just a number to shift the result some number of hours to meet local context. I also assume that getTime() returns the time based on wherever the amazon server cluster is that runs applab. It would take more lines of code to use an if-statement to do the arithmetic for that single line, but would also be much more readable. loosely speaking this: (correct ? timeZoneCorrection : 0) means: if correct is true, then use timeZoneCorrection else use 0. The weirdo ? thing is a short way to do an if-statement (that most people think is ugly and makes code hard to read). (I realize this isn’t a great explanation of why this works, but that’s what it’s doing). You can also pause the timer at any time using the 'Pause' button. 1 hour 20 minute timer will count for 4800 seconds. You can reset the timer at any time using the 'Reset' button. To start the 1 hour 20 minute timer, simply click on the Start button. The timer will alert you when it expires. Press the 'Start' button to start the timer. Since 86400 is the number of seconds in a day, I assume this is an attempt to extract the number of seconds (or miliseconds) that have elapsed so far today. A countdown timer for 1 hour and 51 minutes. When you do %86400 you’re dividing a big number by 86400 and getting the remainder. I assume that time is just the result of getTime(). % is the modulo operator which returns the remainder from division. Math.floor simply returns the whole number portion of a decimal number regardless of how big the decimal portion is. Once you know that, the rest is math to figure out what you want about the time. GetTime() returns the number of milliseconds since midnight, jan 1, 1969. That code snippet looks a little incomplete – don’t know what time variable holds.Īnyway to recreate you need to know the app lab function: Not saying he can’t just feels risky.įWIW he could probably recreate this code himself without copying. Like for example if this is his way of “including mathematical concepts” I would worry about him saying it came from someone else. Great to Relax or Sleep Timer Set a Timer from 1 second to over a year Big screen countdown. Obviously safer if this code isn’t included in the algorithm portion that he highlights for the written responses at all. Talking Clock Our Talking Clock is great for keeping track of the time Video Timers A Clock or Countdown with a video background. If he’s using that code in his app, as long as he doesn’t claim it’s part of his abstraction AND he doesn’t claim it’s his main algorithm, I think it would be okay. I’d love to have others weigh in on this too. You choose how many hours, minutes or seconds the timer should last.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |