473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Average items in a List for specific time interval

2
I have a List of items (type: double). Each item has it's own timestamp.

Now I need to calculate the average of items in a past interval. For example: Average of all items starting from 20 minutes ago until 10 minutes ago. Can someone suggest me how do I go about it?

Thanks a lot!
Mar 13 '13 #1
3 1253
r035198x
13,262 8TB
Where are the times for each item stored?

Average = Total/Count

Are you able to count how may records there are in that period?
Are you able to add the totals of the records in that period?
Mar 13 '13 #2
ambguy
2
Good question and sorry for missing out on that detail.

Yes, I have a count of records from time = 0 to DateTime.Now().

I can also add any of these records.

My confusion is how to fetch items from my List for a specific time interval, say average of 5 minutes, from 10 minutes ago.
Mar 13 '13 #3
Rabbit
12,516 Expert Mod 8TB
Loop through each item and check to see if the time is between the interval you're looking at.
Mar 13 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Andreas | last post by:
Hi! Is it possible to get a time event at a specific time, for instance eight a'clock? My program is running in the background and is minimized to the tray bar. If not, is there a smooth way...
1
by: Rob | last post by:
Hi, I have a question, when you use a random number generator Random() in a loop to generate say 50000 random numbers; is it any difference if you use different time interval between each loop...
4
by: Andrew Poulos | last post by:
How do I convert a length of time, measured in seconds, into a "point in time" type time interval or what's represented as: time (second,10,2) The format is: PS]] where: y: The number of...
12
by: Dave Dean | last post by:
Hi all, I'm looking for a way to iterate through a list, two (or more) items at a time. Basically... myList = I'd like to be able to pull out two items at a time - simple examples would...
1
by: greg chu | last post by:
Hi, not sure who has done this. I want to set up a time interval that could be pass midnight. so people can enter 8AM to 8AM (pass midnight to 2nd day) 8AM to 2 AM (pass midnight to 2nd day)...
0
by: achio84 | last post by:
Hi all, I'm a newbie in .Net programming. I'm developing a web application that has a listbox containing more than 1000++ items. This listbox is dynamic as the content will change on a time...
3
by: Aussie Rules | last post by:
Hi, I want to be able to to have an event fired within my application at a certain time on certain days (such as 2am Monday, Wednesday and Friday) as well as other timers that fire an event...
2
by: Ducknut | last post by:
Hi all, I was thinking that an expert like FishVal might be interested in solving this one (based on his name). I have several fish tagged with radio telemetry tags. These tags send a signal to a...
2
by: =?Utf-8?B?RHJEQkY=?= | last post by:
I understand that the Value put into a DataGridViewComboBoxCell has to be a member of the Items list or an exception is thrown. I also understand that you can override that exception by handling...
1
by: rosae619 | last post by:
Hi all, Here I want to execute batch files for certain time located in a folder. I want to execute in such fashion: 1) First batch (it executes for certain time, get terminated)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.