Calculate average from sources that sends data at different time.
<p>In my current project, I am going to write a function of calculating average Temperature.</p>

<p>A notatable  point of this function is that  it receives data from many temperature sources at different time. Could you advise me "How can I write a function with such a behavior?"</p>

<p>For instance,  following function receives <code>tempSensorData</code> from many <strong>temperature Sensors, which sends temperature data at different time</strong>. I need to write a logic of calculating average temperature.   </p>

<pre><code>public void calculateRoomAvgTemp(TempStruct tempSensorData) {

   // Write logic of calculating Average Temperature.

}
</code></pre>
