Let$Z$($t$) be the classical Hardy function in the theory of Riemann’s zeta-function. An asymptotic formula with an error term$O$($T$^{1/6}log$T$) is given for the integral of$Z$($t$) over the interval [0,$T$], with special attention paid to the critical cases when the fractional part of $\sqrt{T/2\pi }$ is close to $\frac{1}{4}$ or $\frac{3}{4}$ .