timer

is there an event that fires at a specific time?

不羁的心 提交于 2020-01-25 05:19:21
问题 Is there a .NET event that fires at a specific time (eg. at 19:00) as opposed to timer which fires when the countdown finishes? It can be used as a scheduler to call certain method. 回答1: Take a look at Quartz.net. It's a great scheduling library for .net. 回答2: Not exactly but you can use timer and check if it is 19:00 already it its elapsed event and then fire the required code. Otherwise you can put your code in Task Scheduler to get it executed at 19:00 回答3: You can use Quartz.NET to run a

How to create Login Session Timer for individual users

不问归期 提交于 2020-01-25 04:53:28
问题 I've been working on this custom timer I created for each user's login session . Until now I was'nt able to make an individual timers for each login session. Scenario: When User1 logs in, the timer will start counting . When User2 logs in, the timer of Use1 will reset the value is same as the timer for User2. It seems that they have one timer (not individual). Here is what I want to happen. when user1 logs in, his timer will start counting. if the timer reach 900 seconds(15 minutes) it will

Access Violation with unmanaged DLL

牧云@^-^@ 提交于 2020-01-25 04:48:04
问题 Currently, we use an unmanaged DLL from a vendor that allows us to access a particular instrument. The particular function of interest is specified in a header file as this: extern "C" short CCONV acq_get_board_count (); In my application, I have the pinvoke statement: public class bograms { [DllImport("bograms.dll", EntryPoint = "acq_get_board_count", CallingConvention = CallingConvention.StdCall)] public static extern short acq_get_board_count(); } Now, in my code I am attempting to handle

Access Violation with unmanaged DLL

扶醉桌前 提交于 2020-01-25 04:48:04
问题 Currently, we use an unmanaged DLL from a vendor that allows us to access a particular instrument. The particular function of interest is specified in a header file as this: extern "C" short CCONV acq_get_board_count (); In my application, I have the pinvoke statement: public class bograms { [DllImport("bograms.dll", EntryPoint = "acq_get_board_count", CallingConvention = CallingConvention.StdCall)] public static extern short acq_get_board_count(); } Now, in my code I am attempting to handle

Label flashing with timers

依然范特西╮ 提交于 2020-01-25 00:06:25
问题 I'm trying to get a couple labels to flash on a button click. With the current code, the first click works properly, and each click afterwards only does half the amount of blinking it should (to white and back to black). Any ideas on how to improve/fix this? Here's my current code: private int counter; System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); private void button1_Click_2(object sender, EventArgs e) { //Labels start out black, then play a sequence //of changing to

Is there an easy way of obtaining the total page response time in ASP.Net?

安稳与你 提交于 2020-01-24 09:28:33
问题 commonly on say PHP or other web frameworks getting the total response time is easy, just start the timer at the top of the file and stop it at the end. In ASP.Net there is the whole Page Lifecycle bit though so I'm not sure how to do this. I would like for this response time recording to take place in a master page and the response time show up in the footer of pages. What would be the best way of doing this? Is there something built in to ASP.Net for it? Is it even possible to include the

Audio recording in android with particular time interval

China☆狼群 提交于 2020-01-23 17:25:07
问题 I have two method in my activity one is setOnClickListener() and other is setOnLongClickListener() For the same button which used to start audio recording. Now i don't know how to use condition, if i use setOnClickListener() then recording should start for 1 minute and stop automatically, and if i use setOnLongClickListener() then recording start for 2 minute and then stop automatically. buttonStart.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v

boost::asio::deadline_timer::async_wait not firing callback

独自空忆成欢 提交于 2020-01-23 12:07:28
问题 I have a boost io_service running in a thread, and I would like to fire a callback in that thread 6 seconds after a certain event happens to a client, and reset the timer for that client if it is already running. I maintain a unordered_map<string, shared_ptr<deadline_timer>> with a timer for each client. However, upon setting async_wait , my callback does not fire after the alloted amount of time (the io_service IS running), neither does it fire (with an error code) when I reset the pointer

Is the HPET directly accessible in Windows?

百般思念 提交于 2020-01-23 04:51:09
问题 I would like to use the High Performance Event Timer (HPET) for an profiling tool to take very high precision measurements, quickly. timeGetTime does not provide sufficient resolution at 1ms, and QueryPerformanceCounter is much slower per read than I'd like. I came across the HPET while researching the problem, but I can't see any samples of how to actually get at it. So can I use it directly (assembly is fine), or do I have to rely on the multimedia/high performance timing tools already

Timers are interleaved, Dashboard update event getting skipped

折月煮酒 提交于 2020-01-22 04:00:28
问题 I'm working on a Windows Form Desktop application using VB.Net and there is one form which acts as a dashboard having 3 timers where each timer is responsible for its own specific part of the dashboard. The issue is with one timer where that timer should call a user-defined Sub which updates the database, but sometimes the timer gets skipped or ignored, which results in missing dashboard information. I tried using sleep and then Async Await to fix the problem, but the behavior is still the