Sometimes we meet with situation when we don't know asymptotics of a given but we know its average behaviour on $[1,n]$. For example, we can easily get that 


$\sum\_{i=1}^n \tau(n) = n \log (n) (1 + o(1))$ 


but we have only upper bound on $\tau(n)$ itself.


So my question is the next: is there some research (maybe for another NT fucntion) where authors found out minimal number of consecutive arguments (or its growth), such that average value of a given function on such arguments has clear asymptotics, i. e. a function $g(n)$ such that:


$\frac{1}{g(n)}\sum\_{i=n+1}^{n+g(n)} \tau (i) = S(n) (1+o(1))$ 


for some function $S(n)$, which is a combination of polynomials, logarithms and exponents?


Edit: Thanks, Fedor and Gerry, I just try to summarize the best unconditional results on this moment.
Really, this problem is closely related with a problem of error tern estimating for an average. From Huxley work *"Exponential sums and lattice points III" (2003)* it follows that $\Delta (x) << x^{131/416+\epsilon}$, where


$ \Delta (x) = \sum\_{n\leq x} \tau (n) - x(\log x + 2\gamma -1)$,


so one can easily get using a method desribed by Fedor, that


$\frac{1}{h(x)}\sum\_{x<n\leq x} \tau (n) = \log (x)(1 + o(1))$


for $h(x) = x^{\theta}$ with $\theta > 131/146$.


Also Shiu in his work *"A Brun-Titchmarsh theorem for multiplicative functions" (1980)* proved that


$\sum\_{x<n\leq x + h(x)} \tau (n) << h(x) \log (x)$


for $x^\epsilon \leq h(x) \leq x$ with no additional restictions on positive $\epsilon$.



Asymptotics of number-theory functions and its averages
It is known that $\sum\_{x<n\le x+h(x)}\tau(n)$ is asymptotic to $h(x)\log x$ for $h(x)=x^{\theta}$ with $\theta>131/416$, and it is conjectured that the asymptotic holds for $h(x)\gg x^{\epsilon}$. See, e.g., Danilo Bazzanella, On the divisor function in short intervals, Arch Math 97 (2011) 453-458. 


