timer

Is there a code to check if a timer is running?

荒凉一梦 提交于 2019-12-19 16:57:30
问题 I have a game where I am scheduling a timer. I have this CoresManager file: package com.rs.cores; import java.util.Timer; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; public final class CoresManager { protected static volatile boolean shutdown; public static WorldThread worldThread; public static ExecutorService serverWorkerChannelExecutor; public static ExecutorService serverBossChannelExecutor;

How can we count the time of process?

柔情痞子 提交于 2019-12-19 15:33:39
问题 I created a PopupPanel and have shown it. I want to hide it after one minute has passed. During that one minute, the process should not be stopped or paused. How can I achieve this behavior? 回答1: GWT has its own implementation of Timer. Here a really small example: public void onModuleLoad() { final PopupPanel popUp = new PopupPanel(); Label text = new Label("gone in a sec"); popUp.setWidget(text); Timer timer = new Timer() { @Override public void run() { popUp.hide(); } }; popUp.center();

angular timer directive not working with ionic framework

我是研究僧i 提交于 2019-12-19 14:55:52
问题 I am having issues with implementing the angular timer directive with the ionic framework. http://siddii.github.io/angular-timer/ When I implement the code using bower or the google cdn I have no issues. <!DOCTYPE html> <html> <head> <title>Plain Javascript Timer Example</title> <script src="../bower_components/angular/angular.min.js"></script> <script src="../app/js/timer.js"></script> <script> function startTimer() { document.getElementsByTagName('timer')[0].start(); } function stopTimer()

Does Windows provide a monotonically increasing clock to applications

拥有回忆 提交于 2019-12-19 13:46:31
问题 This question is inspired by Does Linux provide a monotonically increasing clock to applications. Maybe I should be more precise: I'm looking for a clock function which is strictly increasing, thus never returning the same value, independant how quick two calls follow each other. 回答1: Yes, GetTickCount() does this. If you want a higher fidelity counter, QueryPerformanceCounter is also available. Neither of these counters depend on the time of day. 来源: https://stackoverflow.com/questions

how to call another intent from countdown timer finish method?

我与影子孤独终老i 提交于 2019-12-19 11:54:29
问题 I am working on android quiz. In my code i have countdown timer when time finish i want next question came and score are decreases (for score decrement currentGame.decrementScore() method). If i add folowing code in timer's finish() method. Its work properly but then my exit button not works properly. When i click on that dialog box appears on pressing yes its remain on current page. After pressing it 3-4 times its exit from current activity and goes on menu page. Then from menu page game

Only raise an event if the previous one was completed

感情迁移 提交于 2019-12-19 11:48:26
问题 I'm using a System.Timers.Timer in my application. Every second I run a function which does some job. The thing is, this function can block for some little time (it reads then processes a large file from disk). I want to start that function only if its previous "execution instance" has completed. I thought I could achieve this with a Mutex : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Timers; using System.Threading; namespace

delphi service application stop after 15 second, timer not executing

馋奶兔 提交于 2019-12-19 11:28:51
问题 I want to make service application in Delphi that run and copy some files everyday at 02:00 PM. So i have used timer. but control not going to timer event and Service terminate within 15 second. I have wrote a code on Timer Event. How can i use timer with service? Please Help. Thanks in Advance. My Code is Here: unit untMain; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.SvcMgr, Vcl.Dialogs, Vcl.ExtCtrls, DateUtils, Vcl.Forms,

Creating Multiple Timers with Reactive Extensions

我只是一个虾纸丫 提交于 2019-12-19 11:02:24
问题 I've got a very simple class that I am using to poll a directory for new files. It's got the location, a time to start monitoring that location, and an interval (in hours) for when to check again: public class Thing { public string Name {get; set;} public Uri Uri { get; set;} public DateTimeOffset StartTime {get; set;} public double Interval {get; set;} } I am new to Reactive Extensions, but I think it is exactly the right tool for the job here. At the start time, and on every subsequent

Atomically cancel asio asynchronious timer from another thread

限于喜欢 提交于 2019-12-19 10:51:58
问题 I have a boost deadline_timer which runs periodically (as in example http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/tutorial/tuttimer3/src.html): #include <iostream> #include <boost/asio.hpp> #include <boost/bind.hpp> #include <boost/date_time/posix_time/posix_time.hpp> void print(const boost::system::error_code& /*e*/, boost::asio::deadline_timer* t) { t->expires_at(t->expires_at() + boost::posix_time::seconds(1)); t->async_wait(boost::bind(print, boost::asio::placeholders::error,

Timer Queue in Windows Service

♀尐吖头ヾ 提交于 2019-12-19 09:44:01
问题 For a Windows Service, I need a timer to perform a certain task regularly. Of course, there are many options that seem superior to a timer (multithreading, calling method directly from the service's main thread), but they all have their disadvantages in this particular situation. However, for obvious reasons, SetTimer() does not work without the message queue of a GUI. What I have done (in Free Pascal) is the following: Create the timer: MyTimerID := SetTimer(0, 0, 3333, @MyTimerProc); In the