×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    28

    Sleep within a while statement???

    Hi!

    I would like to know if its better to place a e32.sleep(x)
    statement within a while true slope?

    What does the sleep function - is it just another while
    statement???

    Is there an advantage according to battery life or
    other things???

    Kind regards!

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Sleep within a while statement???

    Hello,

    e32.ao_sleep(x) tells the program to wait x seconds before moving on to the next instructions. At its simplest form, it can be described as
    Code:
    while (time is not up yet): do nothing
    Last edited by bogdan.galiceanu; 2008-03-21 at 04:11.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    28

    Re: Sleep within a while statement???

    Quote Originally Posted by bogdan.galiceanu View Post
    Hello,

    e32.sleep(x) tells the program to wait x seconds before moving on to the next instructions. At its simplest form, it can be described as
    Code:
    while (time is not up yet): do nothing
    Yes ok but is there a difference for e.g. power consumption
    if the programm waits in a e32.sleep(1000) statement or
    if there is a while slope which takes 1000 seconds???

  4. #4
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: Sleep within a while statement???

    Quote Originally Posted by freaky_911 View Post
    Yes ok but is there a difference for e.g. power consumption
    if the programm waits in a e32.sleep(1000) statement or
    if there is a while slope which takes 1000 seconds???
    Hi,

    Don't think there will be much difference in both cases. But the latter may comsume more power depending upon the statements in the while loop

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Sleep within a while statement???

    Quote Originally Posted by freaky_911 View Post
    Hi!

    I would like to know if its better to place a e32.sleep(x)
    statement within a while true slope?

    What does the sleep function - is it just another while
    statement???

    Is there an advantage according to battery life or
    other things???

    Kind regards!
    hi freaky_911
    both the method the e32.sleep() and the while will lead to a same result.
    but its insisted to use e32.sleep as it is a modular function rather than using loop.
    hope u r satisfied.
    plz give ur feedback

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    28

    Re: Sleep within a while statement???

    Quote Originally Posted by gaba88 View Post
    hi freaky_911
    both the method the e32.sleep() and the while will lead to a same result.
    but its insisted to use e32.sleep as it is a modular function rather than using loop.
    hope u r satisfied.
    plz give ur feedback
    Ok thanks a lot to both answers!
    I prefer while in combination with
    sleep ... So i can use the advantages
    of both cases.

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Sleep within a while statement???

    Quote Originally Posted by freaky_911 View Post
    Ok thanks a lot to both answers!
    I prefer while in combination with
    sleep ... So i can use the advantages
    of both cases.
    hello freaky_911 again
    thats a good answer to ur question itself

Similar Threads

  1. Update SQL statement doesn't work
    By asheeshv in forum Symbian
    Replies: 4
    Last Post: 2008-12-11, 05:41
  2. Replies: 2
    Last Post: 2007-09-12, 20:31
  3. pkg app name (and legal statement)
    By davidmaxwaterman in forum Symbian
    Replies: 0
    Last Post: 2007-03-13, 08:47
  4. How to perform if statement on database
    By zerglim in forum Symbian
    Replies: 3
    Last Post: 2004-07-03, 05:23
  5. timeout? sleep?
    By y10913 in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-02-06, 18:08

Posting Permissions

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