We know that frequency is an inverse value of time [tex]f=\dfrac{1}{t}[/tex] this implies that time is the inverse value of frequency [tex]t=\dfrac{1}{f}[/tex].
Now since f is 40kHz, we can calculate period or duration for that matter time.
[tex]t=\dfrac{1}{40\mathbf{kHz}}=0.000025\mathbf{s}=25\mathbf{\mu s}[/tex]
Hope this helps.
r3t40