×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    33

    How to control time

    I want to search a device for 20 seconds, if timeout the searching will stop.Could anybody tell me ,which function I should call?

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    49
    You could try something like this:

    Code:
    			long	startTime = System.currentTimeMillis();
    			do
    			{
    				// Put your search device code here
    				
    				
    				
    			}			
    			while ((System.currentTimeMillis() - startTime) < (1000 * 20));

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    49
    Oh, you may need a Thread.yield() in there too

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    33

    Thx, I will try ^&ocirc;^

    Thx,I will try


    Br

    linbo75

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×