In the small-angle approximation the period depends only on length and gravity, amplitude-independent, but only approximately, unlike the spring.
Example
In the small-angle approximation the period depends only on the length and gravity, T = 2 pi root L over g — amplitude-independent, but only approximately, unlike the spring.
highlighted = computed this step
The small-swing period
In the small-angle approximation the period — the time for one full swing over and back — depends only on the string length and gravity, not on the mass or (to this approximation) the amplitude.
T=2πgL
A worked value
With a length of 10 metres and gravity 10, the length over gravity is 1, whose square root is 1, so the period is two pi seconds — the same clean value as our spring.
T=2π10m/s210=2π1=2πs
Exact for the spring, approximate for the pendulum
One honest difference: the spring's period truly does not depend on amplitude — that is exact. The pendulum's amplitude-independence is only the small-angle approximation. Swing a real pendulum wide and each swing actually takes a little longer, because the sine falls below the angle. The clean formula is a small-swing idealization, like our clean numbers throughout.
spring: exact=pendulum: small-angle only
mechanicsWith L = 10 m and g = 10 the period is a clean 2 pi seconds; the honest contrast is exact (spring) vs small-angle-only (pendulum).