The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [timer]

This tag is for questions about using timers in code to make things happen in a certain order or for gathering amount of time elapsed.

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
112 views

Tick. Tick. *breathe* BOOM! - Taming the SetTimer API (part 1)

WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...
5
votes
0answers
143 views

Scheduler built with observables v2 (follow-up)

It would probably be too easy if the old Scheduler worked as intended being that simple. But an eye-openig review showed that from time to time it'll miss one ...
5
votes
0answers
464 views

8-bit AVR delay using TIMER0 (8-bit)

Using an Atmega328P clocked externally @ 16 MHz, this procedure is analogous to delay routines that use instructions to consume clock cycles. The intent of this algorithm is not to advocate any ...
4
votes
0answers
67 views

React - pomodoro clock

I'm looking for some feedback on a pomodoro clock that I recently wrote with React. I'm pretty new to React and coding in general. I followed a couple of online courses, but I'm mostly self-taught. ...
4
votes
0answers
65 views

Game clock with configurable rate

Edit: Licensed source can be found here. The intent behind this class is to allow different game systems to run at their own clock rate. The physics integration rate should not be connected to the ...
4
votes
0answers
161 views

Limit drive starts with function block diagram

I have a drive (modulating fan) which needs to be interlocked and prevented from starting. The requirement is that: The drive is limited to 3 starts per hour with a minimum of 10 minutes between ...
4
votes
1answer
5k views

Countdown timer in every table cell

I am making countdown app with multiple records, so I am using UITableView to show that records and countdown dates. What I do is just take one timer and reload cells on every second. Is this a best ...
3
votes
1answer
54 views

Pomodoro countdown timer synced to the clock

This countdown timer is supposed to: be synced to the user's clock at every hour and half hour, will start a 25 minute countdown followed by a 5 minute break The code works but I question its ...
3
votes
0answers
3k views

TTimerThread - Threaded timer class

I was inspired by @LU RD's answer to the question: Using VCL TTimer in Delphi console application, and wrote a bit simplified TTimerThread class. By simplified I ...
3
votes
0answers
40 views

Periodically monitor if record is not updated using Node, Event and setTimeOut

Here is my scenario: Every user checks in every five minutes. If some user doesn't check in after 5 minutes, I should be able to keep track of it. If some user doesn't check in N number of times, an ...
3
votes
0answers
71 views

A version of the Pebble Big Time watch face that also displays the date

I'm seeking style pointers, bugs, memory leaks, incorrect usage etc. ...
3
votes
0answers
448 views

A Timer Construct to Simplify Timing Blocks of Code

This is fairly simple, so I'm just looking for ideas on anything that can be cleaned up, places it can be extended, and suggestions regarding style/naming (I'm terrible at naming). It allows you to ...
3
votes
1answer
120 views

TimeoutManager: check whether a task has been finished within a given time

I want to make a helper class, which raises an event whenever something is not finished in a certain time. Example: my program sends out multiple network messages concurrently. After a random delay, ...
2
votes
0answers
20 views

RxJs observables pipes SwitchMap and async with typealong search input

I'm using RxJs for type along search, I setup an observable to emit a value after 1 second so it behaves like http with delay. I subscribe to it via the async operator in the template, the component ...
2
votes
1answer
45 views

Report time on whole hours

Report time at whole hours ...
2
votes
1answer
110 views

Stopwatch utility class in Java

Looking for input on my code for a Stopwatch utility written in Java. ...
2
votes
0answers
82 views

Python script to take a break

The idea may sound stupid, but this is what I got to know that you should take a break at regular intervals to not to strain your eyes. So the idea is to take break of 2 minutes for every 20 minutes ...
2
votes
0answers
839 views

A clock program in MIPS assembly that start ticking from 59:58

This is an assignment, a clock program which use MARS simulator, it starts ticking from 59:58. In this assignment I have implemented three functions ...
1
vote
0answers
208 views

Timer queue with chrono

I would like to make the timer queue: 1. Each timer has id, time expired and callback to call 2. Queue stores timer and execute the callback of each timer whenever expired. Here is my code and demo: ...
1
vote
0answers
120 views

C++ embedded application to control a light with a timer

I enhanced the my daughter's bed light to IoT. Specifically I can turn the light on/off remotely and there is a timer & alarm function. All of this is implemented with a Particle Photon. This ...
1
vote
0answers
57 views

Solidity code for TimeBasedWill (smart contract)

Following is a TimeBasedWill I have written in Solidity to be built on the Ethereum Blockchain. I have tested the code using Remix IDE. I would like to get your comments and opinions about security ...
1
vote
0answers
37 views

Java Market Summary - JSON

I am writing a java program that will print current market values from a websites api. I used gson to parse the incoming json and Timer to run it every 5 minutes. I was wondering if this was the best ...
1
vote
0answers
968 views

Watchdog for multiprocessing

The code shows here is a demo of my application. The func1 always hang somewhere with reason I haven't figured out by now. Now I just want to write a watchdog for this process. If it didn't generate ...
1
vote
0answers
305 views

Pomodoro Countdown Clock

I would appreciate feedback on this Pomodoro Clock. I tried to use straight Javascript for the logic instead of JQuery and I would be interested in any observations of where that was a good or bad ...
1
vote
0answers
117 views

Timer class to measure time differences

Here is my Timer class code, and the context it is being used in. How accurate is the timer for measure elapsed time? ...
1
vote
0answers
57 views

Restarting properly

I have an activity with a timer in it, which starts an activity when the timer goes down. Before, when onPause() would get called after a phone call, my activity ...
1
vote
0answers
1k views

Millisecond timer using plain standard C++98

For development I'm using timer classes that are based on Win32 functions like QueryPerformanceCounter() or the time stamp counter of Intel-compatible CPUs. However,...
0
votes
1answer
38 views

Suppress API call in Redux Saga based on a timer

I have an API that provides data that is updated on an infrequent schedule, about once every 2½ minutes on average. Assuming that it's okay to fetch only as often as every 2½ minutes or less often, I'...