Forum: Ruby on Rails timing how long a user takes to do a test

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Carl W. (Guest)
on 2006-02-14 02:00
(Received via mailing list)
Hi everyone,

I have a quick problem. What I want to do is time how long a user
takes to do a test. To do this I would like to start a thread which
increments the time for a user. I would like do this for multiple
users and so I wanted to use a hash class variable (static). This
doesn't work from my rails app, how ever it works fine in my test
code. After doing some research I see that webrick executes each
request in a seperate thread. I think this is my issue and it explains
some other decisions made in rails (like storing session data in a
cookie).

I am now thinking that I will have to do a seperate little app that
can time items based on an id. Then have a webservice that can be
access via my rails app. Does anyone have any ideas on how I can
achieve what I want without having a seperate application?

Thanks,
Carl.
Tom M. (Guest)
on 2006-02-14 02:13
(Received via mailing list)
session is your friend.

At start of test, store start time.
At end of time, use it to figure difference.

--
-- Tom M.
This topic is locked and can not be replied to.