473,471 Members | 4,637 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Lookin for web timer sample

Hi,
Tryin to do exam web app.
I need to insert a timer in my app just to check the time the user did to
pass the exam.

There's just one page which reload for each question until the last one.
How could I do that ?

Thks for help.
Nov 19 '05 #1
2 890
Well, the first time the user loads the page, load the current time
(System.DateTime.Now) into something (talk about that in a bit). The last
time, you can do something like:

dim seconds as int = DateTime.Now.Subtract(StartTime).TotalSeconds

About where to store the start time. As far as I'm concerned, it's a
security issue. For performance, you can store it in the viewstate or a
form field (same difference), but then the value could be changed by the
user. Depending on the environment, that might by very unlikely. If this
isn't tolerable, you'll need to use a server-side persistence mechanism,
such as a database or a session.

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mick" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
Hi,
Tryin to do exam web app.
I need to insert a timer in my app just to check the time the user did to
pass the exam.

There's just one page which reload for each question until the last one.
How could I do that ?

Thks for help.

Nov 19 '05 #2
Here's an example that uses the javascript setTimeout function.
http://www.crowes.f9.co.uk/Javascript/timer.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Mick" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
Hi,
Tryin to do exam web app.
I need to insert a timer in my app just to check the time the user did to
pass the exam.

There's just one page which reload for each question until the last one.
How could I do that ?

Thks for help.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Qiangning Hong | last post by:
I asked this question on comp.python.wxpython using the subject "a wx.Timer like timer without wx package?" and David Fraser there suggested me to ask here for a more general solution. I am...
1
by: Skip Key | last post by:
While writing a windows service, I've run into a fairly strange problem. I have a worker proc that gets fired every n seconds using System.Threading.Timer. This works fine, unless I open an...
2
by: Benjamin | last post by:
Hi, I am having a problem enabling a timer in my class. I have attached some sample pseudo code (see "Sample code illustrating issue") so you can see what I am talking about. Whats the issue?...
3
by: jam | last post by:
Dear all, I am wrtiing a console application and doing some test on timer, the below is my sample code I got from some site, but I cannot make it work... Error is 'System.Timers.Timer' does not...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
10
by: Bob | last post by:
Okay, I've done this for years but now I'm going to question it just because this idea has been at the back of my head since I started using DotNet... My WinForms app queries a database every 60...
4
by: Rich P | last post by:
Greetings, I have a routine I was running in VB6 on a timed schedule. When the timeframe came up, the timer would be disable, the routine would run, and the timer gets enabled. I am trying to...
4
by: puntino | last post by:
Hi I have created my Alarm, at compile time I don't have any problem, but at run time I receive the follo wing messages: Exception in thread "main" java.lang.NullPointerException at...
2
by: Guy Cohen | last post by:
Hi all I need a sample with timers. I read the samples on the net with consol output but I want to change (for example) a text box content on my form and this sample is not good for that... TIA...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.