The lifetime of the Sun, T, can be computed from the amount of fuel that the Sun has and the burning rate.
burning rate corresponds to the solar luminosity: Lo
total fuel corresponds to the mass available for nuclear reactions: E = mc2
The efficiency of H --> He fusion is 0.7%.
total fuel = m c2 = Mo x 0.1 x 0.007 c2
Lifetime
Mo = 2 x 1030 kg (mass of the Sun)
c = 3 x 108 m/sec (speed of light)
Lo = 3.9 x 1026 Watts (luminosity of the Sun)