Physical properties are usually a function of the particle coordinates and velocities.
The sum is also updated at each step. At the end of the run the average is immediately obtained by dividing by the number of steps. An example is the system temperature. A separate program, running after the simulation program, processes the trajectory and computes the desired quantities. However, it is often used when the quantities to compute are complex, or combine different times as in dynamical correlations, or when they are dependent on other additional parameters that may be unknown when the MD program is run.