Calculation of "Prompt neutron lifetime" and neutron generation time using Openmc

Can anyone assist me by saying step by step of calculating prompt neutron lifetime and neutron generation time in openmc. If i get any exact code as example ,this will be much more helpfull

Is this how i have to calculate prompt neutron lifetime.

inv_vel_tally_result = sp.get_tally(name=‘inverse_velocity_tally’)
inv_vel_mean = inv_vel_tally_result.mean[0][0][0]
flux_tally_result = sp.get_tally(name=‘flux_tally’)
flux_mean = flux_tally_result.mean[0][0][0]

prompt_neutron_lifetime = inv_vel_mean / flux_mean