Search Results

Search found 1610 results on 65 pages for 'timer'.

Page 9/65 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Timer takes 10 ms more then interval

    - by Praveen
    Hi All, I am using a timer with interval 50 miliseconds. But in the timer's tick event when I print the time it's always 62 or 65 ms. I don't understand why it's taking 10 ms more. Please can some one have look into this. Here is the code I am using. static int _counter; System.Timers.Timer _timer = new System.Timers.Timer(1000); public Form1() { InitializeComponent(); _timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed); _timer.Start(); } void _timer_Elapsed(object sender, ElapsedEventArgs e) { Console.WriteLine(DateTime.Now.ToString("{hh:mm:ss.fff}")); _counter++; if (_counter == 20) _timer.Stop(); } And this the output: {01:59:08.381} {01:59:09.393} {01:59:10.407} {01:59:11.421} {01:59:12.435} {01:59:13.449} {01:59:14.463} {01:59:15.477} {01:59:16.491} {01:59:17.505} {01:59:18.519} {01:59:19.533} {01:59:20.547} {01:59:21.561} {01:59:22.575} {01:59:23.589} {01:59:24.603} {01:59:25.615} {01:59:26.629} {01:59:27.643}

    Read the article

  • Measuring talk time.

    - by Workshop Alex
    Situation: a financial advisor starts talking to a customer after starting a timer. When the conversation ends, he stops the timer and the amount of time is added to a log file with information about the customer. Does such an application already exist?

    Read the article

  • Redirecting Page(php) using Jquery Timer

    - by rag
    i have tried this code to redirect a php page.but it s not working .can any body please tell me the solution(is there any changes needed in the body part of parent page?).... / / here am pasting the code(header part) / <script type="text/javascript" src="jquery/jquery-latest.pack.js"></script> <script type="text/javascript" src="jquery/jquery.timer.js"></script> <script type="text/javascript"> $(document).ready(function() { // This will hold our timer var myTimer = {}; // delay 3 seconds myTimer = $.timer(3000, function() { //redirect to home page window.location = "http://sys3/shinshiva9/shin_shiva/booking_table.php"; }); }); </script>

    Read the article

  • How To Make Moving News Bar in Windows Forms Application without Timer

    - by Ehab Sutan
    I'm making a desktop application in C# which contains a moving News Bar labels. I'm using a timer to move these labels but the problem is that when i make the interval of this timer low (1-10 for example) the application takes very high percentage of CPU Usage, And when i make it higher(200 -500 ) the movement of the labels becomes intermittent or not smooth movement even that the user may not be able to read the news in Comfortable way. ((More Information)) it is Windows form application. the way i move the labels is as follows : the news items from RSS feeds are represented in a group of linklabels. All these linklabels are added to a flowlayout container. The timer moves the whole flowlayout container. I found this way according to my knowledge the best way to making the news bar. If you have better idea or solution please help

    Read the article

  • What is the best type of c# timer to use with an Unity game that uses many timers simultaneously?

    - by Kyle Seidlitz
    I am developing a stand-alone 3d game in Unity that will have anywhere from 1 to 200 timers running simultaneously. For this game timer durations will range from 5 minutes to 4 days. There will not be any countdown displays or any UI for the timers. An object will be selected, a menu choice will then be selected, and the timer will start. Several events will occur at different intervals during the duration of the timer. The events will be confined to changing the material of the selected object, and calling a 1 second sound effect like a chime or a bell. If the user wants to save or end the game before all the timers are done, the start of the still running timers is to be saved to an XML file such that when the game is started again, any still running timers will have a calculation done to see if the timer is then done, where the game will change the materials appropriately. I am still trying to figure out what type of timer to use, and see also if there are any suggestions for saving and calculating times over several days. What class(es) of timers should I use? Are there any special issues I should look out for in terms of performance?

    Read the article

  • What is the best type of c# timer to use with a Unity game that uses many timers simultaneously?

    - by Kyle Seidlitz
    I am developing a stand-alone 3d game in Unity that will have anywhere from 1 to 200 timers running simultaneously. There will be a GameObject containing 1 timer. For this game timer durations will range from 5 minutes to 4 days. There will not be any countdown displays or any UI for the timers. Each object is a prefab, with all the necessary materials included. An attached script will handle the timer and all the necessary code to change the materials and make any sound effects. Once the timer is expired, the user will then click on the object again, and the object will be destroyed, and the user's inventory will be adjusted. If the user wants to save or end the game before all the timers are done, the start value of the still running timers is to be saved to an XML file such that when the game is started again, any still running timers will be checked to see if they have expired, where the object's materials will be changed appropriately. I am still trying to figure out what type of timer to use, and see also if there are any suggestions for saving and calculating times over several days. What class(es) of timers should I use? Are there any special issues I should look out for in terms of performance?

    Read the article

  • Where is my Sharepoint 2010 Custom Timer Job running?

    - by spano
    When building a custom timer job for Sharepoint 2010, special attention should be put on where do we need this job to run. When we have a farm environment, we can choose to run the job on all servers, in one particular server, only the front end servers, etc. Depending on our requirements the timer job implementation and installation approach will change, so we should decide where we want it to run at the first place. All Sharepoint timer jobs ultimately inherit from the SPJobDefinition class. This...(read more)

    Read the article

  • Why I am not able to display image using swing worker?

    - by Vimal Basdeo
    I was trying some codes to implement a scheduled task and came up with these codes . import java.util.*; class Task extends TimerTask { int count = 1; // run is a abstract method that defines task performed at scheduled time. public void run() { System.out.println(count+" : Mahendra Singh"); count++; } } class TaskScheduling { public static void main(String[] args) { Timer timer = new Timer(); // Schedule to run after every 3 second(3000 millisecond) timer.schedule( new Task(), 3000); } } My output : 1 : Mahendra Singh I expected the compiler to print a series of Mahendra Singh at periodic interval of 3 s but despite waiting for around 15 minutes, I get only one output...How do I solve this out?

    Read the article

  • Hot python input loop

    - by Josh K
    I'd like to have something similar to the following pseudo code: while input is not None and timer < 5: input = getChar() timer = time.time() - start if timer >= 5: print "took too long" else: print input Anyway to do this without threading? I would like an input method that returns whatever has been entered since the last time it was called, or None (null) if nothing was entered.

    Read the article

  • Why does my entire page reload in Chrome and Firefox when using asynchronous UpdatePanel postbacks?

    - by Alex
    Being a bit perplexed about this issue by now, I hope some of you gurus can shed some light on my problem... I've developed a AJAX-enhanced website, which has been running fine in IE, Chrome and Firefox for a year or so. I use a Timer-control to check for incoming messages every 30 seconds, and this updates an UpdatePanel showing potential new messages. Now several one of my Firefox users complain about the page refreshing every 30 seconds! I my self cannot reproduce this behaviour, but given the "30 seconds"-description, I cursed my Timer-solution as the culprit. But now, I'm experiencing this error myself, not in Firefox though, but in Google Chrome! (And only on one of my two computers!) Every 30 seconds the page reloads! But I found that it's not only related to the Timer, because all other asynchronous postbacks to the server within UpdatePanels reloads the entire page as well. This error has never been experienced in Internet Explorer (to my knowledge). As I said, this it not only related to the Timer postback, but if it's of interest to anybody the code is like this: <asp:Timer runat="server" ID="MailCheckTimer" Interval="30000" OnTick="MailChecker_Tick"></asp:Timer> <asp:UpdatePanel runat="server" ID="MailCheckerUpdatePanel" UpdateMode="Conditional"> <ContentTemplate> <div class="newmail_box" runat="server" id="newmail_box"> <!-- Content stripped for this example --> </div> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="MailCheckTimer" /> </Triggers> </asp:UpdatePanel> In other places of the website I call the client side __doPostBack function directly from JavaScript in relation to an UpdatePanel. Normal behaviour for this call is to updated the referenced UpdatePanel with some content, but now in Chrome this refreshes the entire page! (but again not consistently, and never in IE) Even the most fundamental UpdatePanel operations like refreshing the content after a button (inside the panel) is clicked, forces the page to reload completely: <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click"></asp:Button> And just to torment me further, I only experience this on my public website, and not in my local development environment, making it a tedious affair for me to find the actual cause! :( Any ideas on why this happens? Why so inconsistently? Has it to do with my UpdatePanel-design? Or does some security setting in Firefox/Chrome that prevent some asynchronous UpdatePanel callbacks? Any help or idea is highly appreciated!

    Read the article

  • Easy Python input question

    - by Josh K
    I'd like to have something similar to the following pseudo code: while input is not None and timer < 5: input = getChar() timer = time.time() - start if timer >= 5: print "took too long" else: print input Anyway to do this without threading? I would like an input method that returns whatever has been entered since the last time it was called, or None (null) if nothing was entered.

    Read the article

  • AlarmManager Calling Function in Same Class

    - by jsc123
    I am trying to give a LocationClient a two-minute period to connect before calling getLastLocation on it. Initially I implemented this with a Timer (and TimerTask), but because Timers do not work in sleepmode, I would like to translate it to an AlarmManager. However, I am a bit confused as to how to do this, considering an AlarmManager calls another class, whereas I want to remain in the same class and simply delay for a two-minute period. This is how it looks with a Timer. Timer theTimer = new Timer(); theTimer.schedule(new TimerTask() { @Override public void run() { if(checkIfGooglePlay() && checkTime()) { getPostLocation(); stopSelf(); mLocationClient.disconnect(); } } }, TWO_MINUTES);

    Read the article

  • Timer class and C#

    - by John Terry
    I have a program written in C#. I want the Timer class to run a function at a specific time. E.g : run function X at 20:00 PM How can I do that using the Timer class?

    Read the article

  • Pyplot connect to timer event?

    - by Baron Yugovich
    The same way I now have plt.connect('button_press_event', self.on_click) I would like to have something like plt.connect('each_five_seconds_event', self.on_timer) How can I achieve this in a way that's most similar to what I've shown above? EDIT: I tried fig = plt.subplot2grid((num_cols, num_rows), (col, row), rowspan=rowspan, colspan=colspan) timer = fig.canvas.new_timer(interval=100, callbacks=[(self.on_click)]) timer.start() And got AttributeError: 'AxesSubplot' object has no attribute 'canvas'

    Read the article

  • jquery timer implementation

    - by Hulk
    All, Is there a jQuery timer which can start a timer for 20 minutes and display time elapsed? Please point me to a small code for it. var austDay = new getTime(); austDay = new getSeconds(austDay); var duration = 1200; duration += austDay; Thanks

    Read the article

  • Timer vs setTimeout

    - by Christophe Herreman
    The docs for flash.utils.setTimeout() state: Instead of using this method, consider creating a Timer object, with the specified interval, using 1 as the repeatCount parameter (which sets the timer to run only once). Does anyone know if there is a (significant) advantage in doing so? Using setTimeout is a lot easier when you only need to delay 1 call.

    Read the article

  • Countdown timer in asp.net

    - by Zerotoinfinite
    Hi Experts, I am using asp.net 3.5 with C#. I want to create a countdown timer and my requirement is like this: Countdown end date: June 16 2010 So, till June 16 comes my timer will show the remeaning time. Please let me know how to achieve it, I google it but i didn't get the excat solution to my problem. Thanks in advance.

    Read the article

  • Countdown timer using jquery or google app engine ?

    - by john
    hi everybody, I need to do a countdown clock, that counts down the days, hours, minutes and seconds that are left to a date of my choice,Using jquery or google app engine(Python). I created a timer using Javascript,But in that i used system time. I need to use server time.Can any body give me ideas to build up a count down Timer using server UTC time.

    Read the article

  • are there any good timer implementation in perl

    - by Haiyuan Zhang
    I'm looking for good timer implementation in perl. The situation I met is like: I need to keep track of I/O activities of many files and for thoes files keep untouched for enough time a remove action will be taken upon them, so an efficient timer implementation is really vital for the app I'm involved right now. To avoid recreate the wheel, ask you guys for help first.

    Read the article

  • How to stop the windows XP timer?

    - by MLB
    Hi guys: I am trying to stop the windows XP timer, and actually I did it. The problem is that I want to do it using another way, not the one used before: running a visual basic script. I need to stop it using a knoppix, or a floppy disk... maybe any other way that I don't know it. Please, how to stop the timer without using a simple script? I am sorry about my English.

    Read the article

  • Creating the concept of Time

    - by Jamie Dixon
    So I've reached the point in my exploration of gaming where I'd like to impliment the concept of time into my little demo I've been building. What are some common methodologies for creating the concept of time passing within a game? My thoughts so far: My game loop tendes to spend a fair bit of time sitting around waiting or user input so any time system will likely need to be run in a seperate thread. What I've currently done is create a BackgroundWorker passing in a method that contains a loop triggering every second. This is working fine and I can output information to the console from here etc. Inside this loop I have a DateTime object that is incrimented by 1 minute for every realtime second. (the game begins in the year 01/01/01) Is this a standard way of acheiving this result or are there more tried and tested methods? I'm also curious about how to go about performing time based actions (reducing player energy, moving entities around the game board, life/death etc). Thanks for any pointers or advice. I've searched around however I'm not familiar enough with the terms and so my searches are yeilding little result on this one.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >