?
Solved

online Timer

Posted on 1998-08-16
7
Medium Priority
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 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