After getting the number of blocks in a session, you need to know what the average block time is, since you can then multiply the two and get average session length in milliseconds. This depends on the particular consensus protocol that is being used for block production, I will assume that you are using a slot-based protocol (either Aura or BABE).
When defining your runtime you will have to specify the slot duration, you can see examples here for the node
and node-template
. Additionally, both the Aura and BABE pallets provide getters for the slot duration: aura
, babe
.