Search Result

Collapse
20 results in 0.0043 seconds.
Keywords
Members
Tags
timer
  •  

  • What is the best way to kill a thread in a Timer?

    What is the best way to kill a thread in a timer such that every time the timer runs, it kills the previous thread before starting a new one?

    Code:
    public class MapTimer extends TimerTask{
    
    public void run() {
    
    
            try {
    
                connected = startConnection();
                sendMessage(this.message);
                System.out.println("Sending message111
    ...
    See more | Go to post

  • plomon
    started a topic wxMessageBox with an auto-close timer in wxPython

    wxMessageBox with an auto-close timer in wxPython

    Platform and Python installation info:

    Platforms: Windows, OS X
    Python: Active State Python 2.7
    wxPython: Version 2.9


    Here is a sample code in which I use a wxMessageBox:

    Code:
    import wx,os
    
    class Frame(wx.Frame):
        def __init__(self, parent, id, title):
            wx.Frame.__init__(self, parent, id, title, size=(100, 100),style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION
    ...
    See more | Go to post

  • How do I schedule a task to run at periodic intervals?

    was trying some codes to implement a scheduled task and came up with these codes .
    Code:
    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
    ...
    See more | Go to post

  • Fuzz13
    started a topic Why am I getting an Arguement Out of Range error?

    Why am I getting an Arguement Out of Range error?

    I'm using a timer from the timer class. There is a combobox with minute, hour, and day inside of it. The timer calls my GetTicks() method where if-thens are used so that based on the word in the combo box being displayed (combobox.text) an int value is returned:

    Code:
    Clock.Interval = GetTimeInTicks(); 
    Clock.Tick += new EventHandler(TimerEventProcessor);
    Clock.Start();
    
    private int GetTimeInTicks()
    ...
    See more | Go to post

  • Dave Elfers
    started a topic cancellable timed loop

    cancellable timed loop

    I am very new to python and programming in general and am trying to build a loop that can be cancelled when the timer ends or cancelled by a variable that will be set externally. I am testing with my code below and it doesn't want to cancel, like it never re-reads the variable to realize that it is no longer a 1. It seems like I am either really close or way off.

    Code:
    import threading
    scalavar = 1
    enable = 1
    def disable():
    ...
    See more | Go to post

  • Will The Gray
    started a topic Using a timer in a game

    Using a timer in a game

    Hi guys

    I have a problem with programming a small game. The idea is that a question pops up, a timer starts to run randomly from one to a given number (that number I take from a database, every question has a different allowed time to "think"), when the timer ends, a random computer opponent between 1 and 2 answers the question randomly correct or incorrect. If the user presses a button, the timer stops, lets the user answer...
    See more | Go to post

  • How to create a video background using frames and timer?

    Im trying to create a video background using frames from a video, and using a timer to run the frames 30FPS , can someone help me out? its for a school project.

    im here so far, i can make this work with a trackbar, but using a timer to automatically refresh the background 30FPS would be a lot more cool =).

    Code:
     
    
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using
    ...
    See more | Go to post

  • BijaN
    started a topic How to stop this timer?

    How to stop this timer?

    Hi,
    I want to stop the timeout of a site with this source (attached)
    Plaese help me.



    It may have two counter i want to stop the second one or all of them.

    thanx for your helps....
    See more | Go to post

  • Looking for help moving text with JS

    I have found a few examples few and far between that do similar things. One constantly moves text up, the other moves it up with a button click.

    What im actually searching for is some super simple code that simply moves up basic text in a div or cell upwards after a short time delay of maybe 10 sec. The idea is a flash banner animates with the text "hidden" below where a user could scroll to ahead of time. When the flash...
    See more | Go to post

  • using timer in serial communication causes unhandled exception

    I am coding in c++ mfc where i try to do serial communication.
    I have successfully done all the connection to the camera and even receive data from the camera.

    However, ran into some problems.

    When i was running the program however, i got a "Unhandled exception at 0x7833dcfa (mfc80ud.dll) in SerialCommunica tion.exe: 0xC0000005: Access violation reading location 0x00000020"

    It points to this particular...
    See more | Go to post
    Last edited by Niheel; May 25 '10, 08:58 AM. Reason: don't need the hellos and thank yous. appreciate you posting question ;)

  • Send timeout message to parent thread without terminating parent thread

    I'm trying to setup a mechanism to read input from a source, but time out after 10 seconds of inactivity from that source. After the mechanism times out, I want to run some end processing on the input.

    I have 2 classes:
    1. Main thread.
    2. Timer class.

    Currently, the timer class times out like so:
    Code:
    public void timeout()
    {
    	System.err.println ("Output finished. terminating");
    ...
    See more | Go to post

  • How to allow thread to finish before next iteratation/check using a Timer object?

    Hi there,

    Im using a Timer with an interval of 1 min (60000 milliseconds) to start a thread in the Global.cs of my application. Everything works fine until the the thread job takes more than 1 min to complete. When the job takes longer that 1 min, the old (currently running) job never seems to get to completion.

    Basically I only want to re-run the thread once its complete but using the Timer so I can potentially leave...
    See more | Go to post

  • gtfrueh
    started a topic VB6 code runs under XP, but not under Win98

    VB6 code runs under XP, but not under Win98

    I have a VB6 project that runs OK under XP, but not under Win98. I have not packaged and deployed. I just copied my working folder of code from the XP machine to the Win98 machine. The code on the Win98 machine runs about 95% successful. The problem is this: I have a timer that, when it goes off, decrements a variable. The variable is used in my mainform, in a loop. I set breakpoints in the timer code and have verified that the variable is indeed...
    See more | Go to post

  • vb .net timer problem with Windows 7 dual processors

    I have been writing visual basic and vb .net applications for years and have come across this problem with the timer component under Windows 7 32bit on dual core Intel processors. This problem only occurs with Windows 7 running on a dual core processor, single core and under the virtual pc on any processor works.

    I have attached a test program to show this problem. The program uses 2 timers to count down to 0. It does not matter...
    See more | Go to post
    Last edited by tlhintoq; Apr 8 '10, 04:20 PM. Reason: [cODE] ...Your code goes between code tags [/CODE]

  • aktor
    started a topic Thread not starting on some machines

    Thread not starting on some machines

    Hi guys,

    I have a weird issue here. I'm writing an automated backup program that, well, performs automated backups of set folders to a set location. It has a GUI and a Windows service. The service has a timer (system.timer) that checks every 10 seconds whether a backup needs to be performed. If it does, it fires a method in a public static class to start the backup.

    Now, this works fine on my PC, and on 2 other test...
    See more | Go to post
Working...