how to display a clock time counter.

22 views
Skip to first unread message

Umair Tariq

unread,
Jan 11, 2015, 12:53:59 PM1/11/15
to rubyonra...@googlegroups.com
Hi, can anyone help me how to display the timer clock that counts the
time since a button is clicked. and then pause that time counter and
then restart and then stop. in Ruby on Rails

--
Posted via http://www.ruby-forum.com/.

Scott Ribe

unread,
Jan 11, 2015, 1:02:53 PM1/11/15
to rubyonra...@googlegroups.com, Umair Tariq
On Jan 11, 2015, at 10:53 AM, Umair Tariq <li...@ruby-forum.com> wrote:
>
> Hi, can anyone help me how to display the timer clock that counts the
> time since a button is clicked. and then pause that time counter and
> then restart and then stop. in Ruby on Rails

That's got nothing to do with Ruby or Rails. It will purely be Javascript executing in the browser.

<http://www.w3schools.com/js/js_timing.asp>

--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




Hassan Schroeder

unread,
Jan 11, 2015, 1:02:58 PM1/11/15
to rubyonrails-talk
On Sun, Jan 11, 2015 at 9:53 AM, Umair Tariq <li...@ruby-forum.com> wrote:
> Hi, can anyone help me how to display the timer clock that counts the
> time since a button is clicked. and then pause that time counter and
> then restart and then stop. in Ruby on Rails

This needs to be done in JavaScript - nothing to do with Rails.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Umair Tariq

unread,
Jan 11, 2015, 1:13:55 PM1/11/15
to rubyonra...@googlegroups.com
Scott Ribe wrote in post #1166486:
> On Jan 11, 2015, at 10:53 AM, Umair Tariq <li...@ruby-forum.com> wrote:
>>
>> Hi, can anyone help me how to display the timer clock that counts the
>> time since a button is clicked. and then pause that time counter and
>> then restart and then stop. in Ruby on Rails
>
> That's got nothing to do with Ruby or Rails. It will purely be
> Javascript executing in the browser.
>
> <http://www.w3schools.com/js/js_timing.asp>

This link display the current time. how can i start increment in a time
from db or a counter starting from zero?

Scott Ribe

unread,
Jan 11, 2015, 1:20:40 PM1/11/15
to rubyonra...@googlegroups.com, Umair Tariq
On Jan 11, 2015, at 11:13 AM, Umair Tariq <li...@ruby-forum.com> wrote:
>
> This link display the current time. how can i start increment in a time
> from db or a counter starting from zero?

We're not here to write your code for you. The link shows you how to execute code periodically, which is what you need in order to increment a counter periodically.
Reply all
Reply to author
Forward
0 new messages