Solved

vb.net - stats per x amount of time

Posted on 2013-01-16
1
204 Views
Last Modified: 2013-01-22
hello there,
I have a little app that I made that downloads images from the web.. I would like to know how can I add two stats.. one that tells me how many downloaded per minute and one that tells me every hr.. how can I do this exactly?
0
Comment
Question by:XK8ER
1 Comment
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 38786387
create 4 counters initialized to zero

save the  the start time to 2 variables (one will be static the other one will be changed every minute)
do {
after each download increment the downloaded1 counter
check if a minute has passed by comparing current time with the start time
if current_ time is >= start time + 1 minute
{
// this is the per minute counter
display downloaded1 counter (this is the per minute)
display download1 counter * 60 (downloads/hour)
//
   totaldownloads = totaldownloads + downloaded1 counter
   set downloaded1 counter to 0
   set starttime = currenttime
} while (filestodownload.count > 0)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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…

746 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

15 Experts available now in Live!

Get 1:1 Help Now