The differential equation of simple harmonic motion is
$\frac{d^{2}y}{dt^{2}}+2y=0$ or $\frac{d^{2}y}{dt^{2}}=-2y\,...\left(i\right)$
Standard equation of simple harmonic motion is
$\frac{d^{2}y}{dt^{2}}=-\omega^{2}y\,...\left(ii\right)$
Comparing eq. $\left(i\right)$ and $\left(ii\right)$,
$\omega^{2}=2$ or $\omega=\sqrt{2}$
As we know, $\omega=\frac{2\pi}{T}$
$\therefore $ Time period, $T=\frac{2\pi}{\omega}=\frac{2\pi}{\sqrt{2}}=\pi\sqrt{2}\,sec$