The formula behind a bar length
A bar's length in seconds comes from three things: how many beats it holds (the numerator), how long each beat lasts, and what kind of note counts as one beat (the denominator). One beat at a given BPM lasts 60/BPM seconds, and each beat in the time signature is worth 4/denominator of a quarter note, so a full bar is numerator × (60/BPM) × (4/denominator) seconds. At 120 BPM in 4/4 that comes to 4 × 0.5 × 1 = 2 seconds per bar.
The same formula explains why compound meters like 6/8 or 12/8 can feel faster than their numerator suggests. A 6/8 bar at 120 BPM is 6 × 0.5 × 0.5 = 1.5 seconds, shorter than a 4/4 bar at the same BPM, because each eighth-note beat is worth less time than a quarter-note beat. Musicians usually feel 6/8 as two dotted-quarter pulses rather than six separate beats, but the seconds-per-bar maths still runs on the written time signature.