×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    35

    Question Need help! How to add a stopwatch in SMS?

    Hello, good evening.

    I'm developing a Short Messagging Service (SMS) which correct textspeak(more about my SMS Textspeak Corrector). Now, I want to add a timer or a stopwatch in the correcting textspeak part. The timer will start only upon pressing the "Send" button because the correcting part is also there in that command along with the sending message. So, there are three functions occur upon pressing the "Send" command (the Correcting, the Timer or Stopwatch, and the Sending).

    The reason why I want to add a timer is to monitor the time of correcting. I want to know how many seconds the correcting part consume. The timer will only stop if the textspeak corrector is already done correcting the text message.

    For example:
    If the textspeak corrector is finish in 10 seconds of correcting textspeak words. It will display an alert saying "Correcting Textspeak takes 10 seconds".

    My question:
    1. Can I add a stopwatch in an SMS in the correcting part? If yes, then can you give me a sample code which will give me an idea on how or where to start since I'm a newbie with this.

    Hope someone will help me with this.

    Thanks.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,553

    Re: Need help! How to add a stopwatch in SMS?

    You can get the current time (in milliseconds) at the beginning of a task:
    long start = System.currentTimeMillis();

    Then you do what you need to do.

    Then you get the time again:
    long end = System.currentTimeMillis();


    And by subtracting the start time from the end time, you know how long elapsed between the start and end times of the task
    long duration = end - start;


    This way you won't know exactly how much time was spent just on the actual calculations/processing of your task, because it is the total elapsed time, where your application/task may have been interrupted/pre-empted by other stuff (other apps or things the system does, or even other threads in your application), etc. But in general terms, this approach is probably accurate enough for your needs.

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    35

    Re: Need help! How to add a stopwatch in SMS?

    Hello petrib, good evening.

    Thanks for helping me....It works....

Similar Threads

  1. How to add from address to SMS in Inbox
    By NevePankaj in forum Symbian
    Replies: 4
    Last Post: 2009-01-09, 10:34
  2. How to add customized format in Help screen
    By kumar24kk in forum Symbian
    Replies: 1
    Last Post: 2008-12-18, 15:23
  3. how to add .dll in pkg?Help
    By zhang198544 in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2008-07-18, 05:56
  4. Replies: 6
    Last Post: 2008-05-15, 07:55
  5. Need help:How to add icons in a form dynamically?
    By dc-huang in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-09-20, 06:58

Posting Permissions

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