Compiling a program on Linux that calls POSIX timer functions (eg: timer_create, timer_settime) returns errors such as:
In function `foo':
timer.c:(.text+0xbb): undefined reference to `timer_create'
timer.c:(.text+0x187): undefined reference to `timer_settime'
collect2: ld returned 1 exit status
Which library do I need to link?
...
I wish to calculate the time it took for an API to return a value.
The time taken for such an action is in the space of nano seconds. As the API is a C++ class/function, I am using the timer.h to caculate the same:
#include <ctime>
#include <cstdio>
using namespace std;
int main(int argc, char** argv) {
clock_t start;
dou...
C# What is the easiest way to disable a control after 10 seconds? Using a Timer or a stopwatch? I'm new to both so thanks for the help.
...
Hi,
I've just written a small XBox 360 Wireless Controller managed interface that basically
wraps around the low-lever SlimDX wrapper library and provides a easy, managed API for the XBOX 360 controller.
Internally, the class polls the gamepad every N ms, and shoots events as it detects changes in the underlying state of the controller....
How do I create a batch file timer to execute / call another batch through out the day Maybe on given times to run but not to run on weekends ? Must run on system times can also be .cmd to run on xp server 2003
...
When measuring network latency (time ack received - time msg sent) in any protocol over TCP, what timer would you recommend to use and why? What resolution does it have? What are other advantages/disadvantages?
Optional: how does it work?
Optional: what timer would you NOT use and why?
I'm looking mostly for Windows / C++ solutions, b...
Hi,
What are the advantages/disadvantages to running time based jobs using:
windows services
Application_BeginRequest to start seperate threads / timers.
One disadvantage of running the jobs in the context of a asp.net web appplication is during .net recycling things will have to be setup again, any others?
...
Hi,
I am developing an online examination using servlets/jsp.I need to add a count down (hh/mm/ss) timer to the questions page that would end the exam and redirects to results page.
I am done with all the other functionalities except the timer one.
Can someone provide some help on this.
Thanks
...
C#:
public partial class MainWindow : Window
{
Storyboard a = new Storyboard();
int i;
public MainWindow()
{
InitializeComponent();
a.Completed += new EventHandler(a_Completed);
a.Duration = TimeSpan.FromMilliseconds(10);
a.Begin();
}
void a_Completed(object sender, EventArgs e)
...
Does anyone know how a System.Windows.Forms.Timer affects the host application and the system in general?
A threaded background loop on one hand has a very high CPU usage %, whilst a Timer with a very high tick rate shows no effect in Windows Task Manager.
Does a high tick-rate timer clutter up the Windows Message loop, or?
...
In a java class i have two timers
TimerTask t1 = new TimerTask() {.. }
TimerTask t2 = new TimerTask() { ...}
Do t1 and t2 execute as two separate threads, how do you verify it
...
I am planning to use this to poll a database which can take close to 10-15 minutes or more, so should I be using timers for this.
...
Accuracy Vs. Precision
What I would like to know is whether I should use System.currentTimeMillis() or System.nanoTime() when updating my object's positions in my game? Their change in movement is directly proportional to the elapsed time since the last call and I want to be as precise as possible.
I've read that there are some seriou...
I was asking about specifics with this approach earlier today here but the confused responses has me wondering if I'm going about this all wrong.
So here's the problem. I need to architect a WinForms application that periodically checks a value from some external service. If it is in a certain state the application is supposed to pop ...
Hi,
In my .net windows service, when my timer elapses and my main method is called, is it best practice to put the timer in sleep mode?
This is in case my main method runs for too long, and the timer elapses before the previous calls main method finishes its execution.
...
I have a method which should be delayed running for a specified amount of time.
Should I use
Thread thread = new Thread(() => {
Thread.Sleep(millisecond);
action();
});
thread.IsBackground = true;
thread.Start();
Or
Timer timer = new Timer(o => action(), null, millisecond, -1);
I had read some articles about using Thread.S...
I have a windows service written in c#. It has a timer inside, which fires some functions on a regular basis. So the skeleton of my service:
public partial class ArchiveService : ServiceBase
{
Timer tickTack;
int interval = 10;
...
protected override void OnStart(string[] args)
{
tickTack = new Timer(1000 * ...
E.g. if I set a timer to expire every day at midnight, what will happen if one "misfire" (does not trigger the callback because the server is down, for instance) ? I can't find that in the documentation.
Is there a way to make this timer triggers the callback as soons as the server restart ?
PS: I know about Quartz, i'm evaluating EJB ...
I have a page where when some operation goes wrong i want to start the timer, wait 30 second, stop the timer and retry the operation. Every time the timer starts I need to inform the user about it by changing some label's text.
How can I do it?
...