Все вопросы: [timer]

280 вопросов

2
голосов
2ответов
2506 просмотров

Typical scheduling time quantum in modern operating systems

What are typical durations of an operating system process/thread scheduling quantum? I realize that this can vary with the scheduling algorithm, priorities, workloads, hardware, etc., so I'm expecting answers to come with conditions/assumptions, or to be ballpark. I can find examples that seem t...

0
голосов
1ответов
3745 просмотров

C# - Countdown Timer Using NumericUpDown as Interval

I'm sure this has been asked before, but I cannot seem to find a solution that works. I have a NumericUpDown on my form and a label along with a timer and a button. I want the timer to start when the button is pressed and the interval for the timer to equal that of the NumericUpDown and a count...

0
голосов
1ответов
4491 просмотров

Timer interrupt problem in vb.net

I have 2 timers in MVB 2008 Express, one to control the fading in of a window and another to call a beep function every few seconds or so. The problem is that while the window is fading in, it pauses while the timer beeps. Any ideas? Threads maybe?

0
голосов
2ответов
1406 просмотров

Can you flick the idleTimerDisabled boolean on and off from within your app?

For example I have a game with a menu screen and then I have the game itself. I want the timer disabled whilst playing the game but enabled when in the menu screen. I currently have the following code in my app delegate that disables the timer: application.idleTimerDisabled = YES; Any help wou...

1
голосов
3ответов
2785 просмотров

How do I manage Java timer tasks?

I'm looking for some guidance on how to manage multiple timer tasks. I'd like to be able to dynamically create timers and then when each timer is finished, it'll reset itself. Example: Timer 1 - perform action x - reset to perform action x again in 30 minutes Timer 2 - perform action y - ...

1
голосов
1ответов
2082 просмотров

C# task scheduler query

Hi I have developed a scheduler sometime back for an ASP.Net site using cache expiration callbacks. I have the budget now to move the site to a dedicated server so I have written the scheduler as a windows service using a timer object - its working well in test envirinment. I want to know if the...

2
голосов
3ответов
5091 просмотров

Simple Javascript MYSQL checking function

I'm not very skilled in web developing by the moment but i've managed to create a web application with PHP that queries a MYSQL Database and shows data in HTML. I would like to check if the table has changed using a timestamp field that I already created and that updates on every insertion. Comp...

2
голосов
4ответов
1922 просмотров

StopWatch (System.Diagnostics) and System.Timers

I am new to handling threads. What is the role of System.Diagnostics and System.Timers in the context of Threading ? Both are alternative to each other or they implemented for doing some unique tasks?

3
голосов
6ответов
778 просмотров

A problem with MyThread and the Timer Control

I have a method, which is being invoked in the second Thread: public byte[] ReadAllBytesFromStream(Stream input) { clock.Start(); using (...) { while (some conditions) //here we read all bytes from a stream (FTP) { ... (in...

2
голосов
5ответов
713 просмотров

(Win/C#/.Net) Applet needs to poll at hourly interval - recommendations on best method?

Applet needs to poll for existence of a directory, say, every 1-4 hours, and send a couple emails/NET SENDs if it is not found. Not sure on exact interval yet, but it will definitely not be shorter than 1 hour. The overall "job" will be permanent and continuously-running for the foreseeable fut...

0
голосов
7ответов
402 просмотров

jQuery iterative Timer

I want to create a jQuery iterative timer. For this I wrote the following script: $(document).ready(function(){ var t; function x() { alert('x') t = setTimeout("x()",1000); } x(); }); First time the function x() called successfully. But from the next functio...

0
голосов
3ответов
2129 просмотров

Changing visibility in WPF with a timer

I have an application where I need to switch visibility of some controls using a timer. Each 5 seconds, some controls disappears while some other appears. When I used a timer, it says that cannot change the visibility because the timer thread is not the owner of the control. How can we bypass th...

2
голосов
4ответов
1107 просмотров

Will a large number of timers affect timer firing?

If i have a large number of timers (10 to possibly a couple hundred) all with <100 ms interval, will that affect the firing of any one of them?

1
голосов
1ответов
513 просмотров

One-off System.Threading.Timer state not finalized until program exit

I may be doing something dumb, in which case I apologize. I'm working with the System.Threading.Timer class, and am setting on-off timers, using a state object to pass control information. Everything is work as I expected, except that the state object doesn't get finalized until the program exits...

7
голосов
6ответов
44316 просмотров

How do I count how many milliseconds it takes my program to run?

This will show how many seconds: #include <iostream> #include <time.h> using namespace std; int main(void) { int times,timed; times=time(NULL); //CODE HERE timed=time(NULL); times=timed-times; cout << "time from start to end" << times; } This w...

2
голосов
4ответов
584 просмотров

Showing message only once

The below code is in OnTimer event. If items from 2 list boxes are not matching - ShowMessage. I need to show the message only once, but because the timer is running, the message keeps popping up at the timer's set interval. I tried disabling the timer after ShowMessage line but then the message ...

10
голосов
6ответов
4595 просмотров

What is the maximum precision of the Timer in .NET?

I'm wondering what the precision of the Timer class is in System.Timers, because it's a double (which would seem to indicate that you can have fractions of milliseconds). What is it?

0
голосов
2ответов
1069 просмотров

Count-Up Timer Required, iPhone Programming

I am new to iPhone programming so am hoping someone can help me out here. I have searched the web, but can only find information on count down timers. What I am looking to do is start a count up timer when a button is pressed and then stop it when a certain value drops by, say 5, and finally dis...

2
голосов
2ответов
1339 просмотров

System.Threading.Timer and 49.7 days timer roll-over

Is it safe to use System.Threading.Timer in windows service running for a long time? In other words, is the 49.7 days timer roll-over problem fixed in Windows Server 2003 32bit + .Net Framework 2.0? Is Thread.Sleep() the only alternative? Thank you.

1
голосов
7ответов
1328 просмотров

How to request a page every 30 minutes

This is a question regarding best practices. I hope to get some advice from other developers. I need a page on my website to be requested at least once every 30 minutes. What I am trying to achieve is a timer that runs code I have in the web application. There are some websites that check if yo...

1
голосов
2ответов
2040 просмотров

Timer intervals, Making 1 timer stop another timer -

Hey guys im trying to get a simple button masher up, What i want timer1 to do is mash keys in richtextbox1 for 30 seconds over and over, after 30 seconds Activate timer2, which will disable timer 1 and press keys in richtextbox 2 once, then wait 10 seconds and activate timer 1 again. Im extremle...

9
голосов
6ответов
17812 просмотров

How to run a task daily from Java?

How can I run a task daily at a specified time (say 11:00 am) using java.util.Timer? I'm using JDK 1.4.2, I know it's old, but it's what the project requires.

2
голосов
4ответов
555 просмотров

Coder's block: How to fire timer at intervals, compensating for early/late firing

I'm having a silly-yet-serious case of coder's block. Please help me work through it so my brain stops hurting and refusing to answer my questions. I want to fire a timer at intervals up to a final time. For example, if t = 0, my goal is 100, and my interval is 20, I want to fire at 0, 20, 40, 6...

0
голосов
2ответов
719 просмотров

(ASP.NET AJAX) How do you disable the ticker after it fires an event?

So i'm implementing a feature where after a user has visited my site, and not signed in and not registered for over two minutes, an alert pops up and asks them to take a survey. I agree, annoying, but it's a business requirement. I thought about doing a Session Object, and then in the page_load...

0
голосов
1ответов
1710 просмотров

Textbox and focus problems with Timer controls(asp.net)

I am needing to create something like a lock timer(a little thing that just updates a lock time in a database). I thought the Timer control would suite my needs, but whenever the Timer control causes a partial post back, recently typed text in a textbox can disappear(inbetween the post back begin...

72
голосов
14ответов
71503 просмотров

C++ Cross-Platform High-Resolution Timer

I'm looking to implement a simple timer mechanism in C++. The code should work in Windows and Linux. The resolution should be as precise as possible (at least millisecond accuracy). This will be used to simply track the passage of time, not to implement any kind of event-driven design. What is th...

36
голосов
3ответов
24721 просмотров

High-Performance Timer vs StopWatch

Does anyone know if the HiPerfTimer or the StopWatch class is better for benchmarking, and why?

0
голосов
1ответов
424 просмотров

rusage() measured in seconds or millseconds?

Hi I'm trying to get the system time and user time of applications being forked by a shell. I'm just not sure what kind of time I'm getting, seconds? milliseconds? Does anybody know? printf("System time: %ld.%06ld sec\n",usage.ru_stime.tv_sec, usage.ru_stime.tv_usec); printf("User time: %ld.%...

1
голосов
1ответов
1776 просмотров

getrusage() get system time, user time. Unix programming help

I am writing a shell where I need to launch several child processes at once and record the system time and user time. So far I am able to do it. The only problem is that I am using wait4 to grab the system resources used by the child program and put it in my rusage structure called usage. How c...

3
голосов
6ответов
693 просмотров

Cocoa counterpart to Windows' SetTimer

Is there any equivalent function on OS X to SetTimer in Windows? I'm using C++. So I'm writing a plugin for some software, and I need to have a function called periodically. On Windows I just pass the address of the function to SetTimer() and it will be called at a given interval. Is there an ea...