×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    3

    Waiting in Seconds

    Hi All
    i want to know how to use RTimer's At to wait in seoconds,
    is Inactivity helpful in this regard?
    Thanks & Regards
    Ashok

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: Waiting in Seconds

    It is always advisable checking the documentation of "system" classes in the SDK Help...
    RTimer::At will notify you at a given time. It expects you to provide the given time in TTime, so also check that one: you will find that you can get current time with TTime::HomeTime, and add a second with TTime:perator+=(TTimeIntervalSeconds aSecond)
    However if you have already checked RTimer, you will find RTimer::After, which notifies you after a specified time interval. It makes more sense to use this one for your case I think. Note that you have to specify time in microseconds.

  3. #3
    Registered User
    Join Date
    Mar 2006
    Location
    India
    Posts
    503

    Re: Waiting in Seconds

    with RTimer:

    TTimeIntervalMicroSeconds32 timeIntervalMs(60000000);
    RTimer timer;
    TRequestStatus timerStatus;
    timer.CreateLocal();
    timer.After(timerStatus,timeIntervalMs);
    User::WaitForRequest(timerStatus);

    ///
    wait without RTimer
    TTimeIntervalMicroSeconds32 aInterval = 4000000;
    User::After(aInterval);
    Regards
    Kamal :)
    ------------------
    You never expect what expects you.

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    3

    Re: Waiting in Seconds

    Thank you wizard_hu_.It is working.
    To Use After ,It takes TTimeIntervalMicroSeconds whose max range is +-35 minutes, 47 seconds
    But i am looking for more so i need to give Seconds as Input so At() is working.
    Thankyou again.
    Ashok

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Waiting in Seconds

    Try the At() instead of After() then..

  6. #6
    Registered User
    Join Date
    Nov 2007
    Posts
    17

    Re: Waiting in Seconds

    Note, that timers get aborted regularry on devices.
    Most probably, because they update system time from network.
    I suggest you make an active object that handles KErrAborted (i.e. restarts timer, if needed)
    Otherwise, your code will wait less than you intended.

Similar Threads

  1. repeat myscripts every 30 seconds..
    By martinorob in forum Symbian
    Replies: 4
    Last Post: 2008-12-22, 22:32
  2. Show baloon for 5 seconds, disapear for 3 seconds, apear again in 5 seconds
    By RAiNMAKER in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2008-10-14, 07:00
  3. seconds 2 hh:mm:ss
    By heuri in forum Symbian
    Replies: 7
    Last Post: 2008-07-16, 16:37
  4. Audio Capture, last 3 seconds of audio chopped off
    By aztec30 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2006-09-15, 18:28
  5. Replies: 1
    Last Post: 2002-12-16, 12:33

Posting Permissions

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