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.

Filter by
Sorted by
Tagged with
2
votes
1answer
2k views

Timer class in PHP OOP

I have done a lot of research on OOP and I keep seeming to read different opinions on several items, especially the scope resolution operator (::) and handling ...
5
votes
2answers
19k views

Timer Tick Event only to execute at specific time

I have a timer that is only supposed to tick between x and x on weekdays. I have used the following implementation. ...
2
votes
1answer
724 views

Singleton Boost-based timer

I would like a review on this code, and how I could make it better. ...
5
votes
1answer
420 views

Managing a stopwatch mobile app

I'm using the following pattern in my mobile app. The code snippet below manages a stopwatch. Is there a way to simplify the code for better readability and probably getting away from needing to use <...
11
votes
1answer
6k views

Timer to poll a Delegate

This is a followup to this where I was initially using a single thread and Thread.Sleep() to poll a delegate. I was recommended to use a timer and the ...
4
votes
2answers
170 views

Timer class, to be taken as a model for other classes

I wanted a timer, rather like the Visual Basic object, and I wanted it with no cumulative error. And I wanted it flexible, so I wouldn't have to write another one. I'm very lazy BTW, so lazy that I ...
2
votes
1answer
171 views

Timed series of events. Logic for organizing events based on time? [closed]

I would like to execute a series of events at the time at which they occur. The events are stored in a list and always sorted by time of execution. ...
1
vote
1answer
2k views

Timer implementation

I have a Visual Studio 2008 C++03 project where I need a timer. I have an implementation that works well, but I'd like any general suggestions from the community on how to improve it. (More generic, ...
1
vote
1answer
848 views

Timer wrapper review

I used this code in several projects. But I am not sure if it is stable. However on production it is working well, but I want to listen your advices: ...
2
votes
3answers
6k views

Timer class for games

I've tried to write a simple timer class that could later be used in games, such as for updating the screen every second. Problem is, I read gettimeofday() was UNIX-...
3
votes
4answers
10k views

Linux C++ Timer Class: How can I improve the accuracy?

I wrote this class today, but I am trying to figure out how to make it more accurate. I pass in seconds and multiply by 1000 to make it milliseconds, and the time does not line up. I need the ability ...
5
votes
1answer
4k views

Timer framework in C

I am trying to create a very simple timer framework which allows you to setup event handling based on a timeout. The basic primitives allow the programmer to: allocate or free timers arm/disarm ...
5
votes
1answer
206 views

qos method call using DateTime and Stopwatch

I need to limit method call to 80 times per second (for each connectionId). My initial version: ...
4
votes
1answer
1k views

Outputting a countdown in a div

I got this code working with the jQuery Countdown Plugin to take a string input and output a countdown in a div. Is there a better way of implementing this? JSFiddler HTML ...
7
votes
2answers
1k views

Homemade Stopwatch class

Here's some explanation for accuracy and neg_accuracy: It's meant to keep all the values in terms of what the user specified he ...
14
votes
2answers
299 views

Executing a program with a temporary directory and measuring the running time

I need a code review for best practices and code correctness of the following piece of code. run executes a program and validates in output. If the output is valid ...