timer

POSIX Timer : Signal Handler for Timer freezes

天涯浪子 提交于 2019-12-24 08:31:26
问题 This post is related to: POSIX TIMER- Have multiple timers I want to call a function in the SignalHandler. This function is a TCP socket client(getSpeed). It gets data from a server every time the timer ticks one second and sends a signal which then calls the corresponding handler. First of all I am not sure if it is good practise to call a function from a signal handler. Now the problem is, my code freezes randomly whenever I execute this program which talks to a server. If this way of

How do I use sendmessage for sending wm_timer that has timer proc in win32

给你一囗甜甜゛ 提交于 2019-12-24 08:23:49
问题 I have a timer, ID 1, which has a timerproc as a callback function. I am making the other timers (ID 2, 3, ...) in the timerproc and they use WM_TIMER event, not another timerproc. When creating window, I want to immediately generate Timer Event, ID 1. So I used SendMessage function like that SendMessage(hWnd, WM_TIMER, 1, (LPARAM)&timerproc); but it didn't work. How do I activate timerproc at right that the first time of window? void CALLBACK MakeRain(HWND hWnd, UINT iMessage, UINT_PTR

Test Fragment not executing Timers or Sample Timeout

久未见 提交于 2019-12-24 07:41:04
问题 I add in JMeter Test Fragment with Sample Timeout and Timers but without any Samplers. I add a Module controller using this Test Fragment in Thread Group with Samplers in same hierarchy (before and after, also HTTP samplers). I expected that the Timers and Sample Timeout will work on every Sample in scope but no timeout/delay is been done, Also I notice that Sampler can be a child of Module controller but it won't be executed (or Timers). It seems like a bug, but maybe there are scoping rules

ASP.NET/AJAX - Timer not working correct

给你一囗甜甜゛ 提交于 2019-12-24 07:37:06
问题 I'm trying to make an webapplication where you see an Ajax countdown timer. Whenever I push a button the countdown should go back to 30 and keep counting down. Now the problem is whenever I push the button the timer keeps counting down for a second or 2 and most of the time after that the timer keeps standing on 30 for to long. WebForm code: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="geen verbinding"></asp:Label> <br />

NTP and RTC HW Clock weird results

偶尔善良 提交于 2019-12-24 07:33:15
问题 In an attempt to make the system time on an ODroid as close to realtime as possible, I've tried adding a real time clock to the ODroid. The RTC has an accuracy of +/- 4ppm. Without the realtimeclock, I would get results like this (Synced with NTP-server every 60 seconds). The blue is an Orange Pi for comparison. The x-axis is the sample, and the y-axis is the offset reported by the NTP-server in ms. So what I tried, was the same thing (Though more samples, but same interval), but instead of

How to stop System.Timers.Timer

吃可爱长大的小学妹 提交于 2019-12-24 07:27:56
问题 I'm using Windows Forms to start a System.Timers.Timer to fire an event every 3 seconds. When I close the form the process keeps firing, and that's fine. The problem happens when I reopen the form to stop the timer on click of a button btnSendOff_Click . System.Timers.Timer sendTimer = new System.Timers.Timer(); sendTimer.Elapsed += new ElapsedEventHandler(sendProcessTimerEvent); sendTimer.Interval = 3000; private void sendProcessTimerEvent(object sender, EventArgs e) { MessageBox.Show("Send

Ajax jQuery Fade in of php content

為{幸葍}努か 提交于 2019-12-24 06:45:34
问题 Im using a timer to call an ajax function that loads in a response from a seperate php page. I want to make it so the content fades out then fades in with the response ever so often. Here's my code - i can grab the content and make it change just the fading in part im at a loss with. <script type="text/javascript"> window.setTimeout('runMoreCode()',100); $(document).ready(function(){ $('#refreshRecords').fadeIn(2000); }); function runMoreCode() { if (window.XMLHttpRequest) {// code for IE7+,

How to handle exception using Timer (Thread) class

筅森魡賤 提交于 2019-12-24 05:38:47
问题 I'm trying to handle the Timer 's exception. It would be nice if the class had something like HandlerExceptionEvent so that we could add some event to log something or stop the timer. PS: I don't want to add a try / catch block inside ElapsedEventHandler() . class Program { static void Main(string[] args) { System.Timers.Timer t = new System.Timers.Timer(1000); t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed); t.Start(); System.Threading.Thread.Sleep(10000); t.Stop(); Console

Update a progress bar while JSONDecoder is decoding a huge object, in Swift

限于喜欢 提交于 2019-12-24 05:20:06
问题 I'm decoding several gigabytes of JSON encoded data like this let decoder = JSONDecoder() let table = try decoder.decode([LogRow].self, from: content!) where content is plain text. Now, this operation can take several minutes, depending on the size of content , and I'd like to show some kind of progress. This is a command line program, so even a periodic update on the length of table would be enough. The problem is that I don't see anything like a callback or something like that. I tried with

How to set timer in C#?

假装没事ソ 提交于 2019-12-24 03:58:09
问题 I am making a program in C# that will ping "google" after every 15 minutes. If the ping is successful, it will then again check(ping) after 15 minutes and so on...If the ping is not successful, it will execute my ISP's dailer and will check again after every 15 minutes. I have written all the code but I can't seem to set the timer to repeat the code after every 15 minutes. If someone could help me, I would really appreciate it. This is the code. using System; using System.Windows.Forms; using