Solved

online Timer

Posted on 1998-08-16
7
169 Views
Last Modified: 2010-04-04
I need a online timer algorithm that calculates the time zone i am in and works out a cost for that second, it is for a program that claculates the online time spent on the internet and gives a real time cost per second, it is for a school project i have to give in soon, pleeeeasssseeee help. It should give the duration and the total cost for that time worked out by the second. Please mail me
David
appledre@voss.net.co.uk
0
Comment
Question by:dapple
  • 4
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1335529
0
 
LVL 1

Author Comment

by:dapple
ID: 1335530
Zifnab you misunderstood This does not answer my question
i mean i want to work out the amount of time i have spent onlne
and a cost per second in real time for that duration. I need to know which time zone i am in i.e 08:00 - 18:00 peak rate or
18:00 - 8:00 evening rate, this should be calculated every sec
then charge an amount for that second. So it will give a start time for the call a duration and a cost every second.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1335531
Sorry.

Ok, then what do you already know.

Do you have some strategy? What values are user put-ins? Are the time-zones entered by the user? What do you need to know, without  input from the user.

Zif.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 1

Author Comment

by:dapple
ID: 1335532
The user inputs the peak start time and finish time e.g.
08:00 - 18:00 also the cost per min for each period peak, evening, weekend e.g 3 pence/min. The app then gives the start time when the DUN starts a duration since the start and the current cost using the value the user entered. I want to know the algorithm for working this cost out.
I tried increment a variable every sec to represent the number of seconds in each time zone e.g.
18:00 - 23:59 inc(daysec) then use the number of secs to work the cost but this was not accurate i need to use the start time and endtime to work it. How would you go about it?
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1335533
? dapple, I think I still don't fully understand your problem.
Why not using the Time function which returns the current time?

1. When DUN starts, put the current time in a variable, look in which time-period you are
2. Then get your new time (every second in your case), look in which time-period you are for this new time.
 - in the same  : (TimeNew-TimeStart) in minutes * money = ...
 - in different : First calculate the previous cost
                  + New cost, because new time-period.

.

Zif.

Am I missing something?
0
 
LVL 1

Author Comment

by:dapple
ID: 1335534
ok no problem i will try and work it thanks for your time
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1335535
dapple, you didn't have to accept my answer already, first try it out!! Zif. Let me know when you've some problems.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question