The lifetime of a star depends on the luminosity of the star (how fast it consumes itself) and the mass of the star.
Example:
A 10 solar mass star has a lifetime of 0.0031 "solar units" (lifetimes of the Sun). To convert this to years multiply by 10 billion or 10 000 million which tells us that the lifetime of the star is expected to be:
0.0031 X 10 000 million = 31 million years!