Time-weighted averages and integrals