Solved

online Timer

Posted on 1998-08-16
7
167 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now