Get current time of timer

0 votes
I have created one timer of 120 second on server. I am starting that Timer from code. Now i wants to get the exact time of timer that how many seconds already passed for that particulat timer. For example: TImer-120 second, Start timer , within 120 second i want to get the exact amount of seconds already been passed. Your timer service provides start, cancel, isTimerRunning kind of functionalities but its not providing such functionality What is the solution for this ?
asked Aug 24, 2016 in Android by testdemo772 (47 points)

1 Answer

0 votes
Hi,

Whenever you create a timer then you will get start time in the response. You can save that time locally at the client side and keep calling get current time api. You can calculate the difference to get the seconds already passed from the start time.

Please let me know if you have any other queries.

Regards,

Rajeev
answered Aug 24, 2016 by rajeev.etc (1,660 points)
timerService.isTimerActive(timername, userName, new App42CallBack() {
   public void onSuccess(Object response)
                {
                          Timer timer = (Timer)response;
                         System.out.println("TIME="+timer.getCurrentTime());
              }
                public void onException(Exception ex)
                {
                    System.out.println("Exception Message"+ex.getMessage());
                }
            });


Here "TIME=" always prints null even though timer is running.. why
Hi Test Demo,

In order to get the current time of server, you need to call getCurrentTime API(http://api.shephertz.com/app42-docs/timer-service/#get-current-time). Please have a look into it and let me know if it helps.

Regards
Himanshu Sharma
I don't want to take server current time....
I want to get the current time of timer running and which is  already been started..
TImer for 100 sec started and after some time i want to get that at which second that timer reached
Hi,

I believe the query has been resolved for you. If you still facing any issue then please let us know.

Regards,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...