Cost calculation in real time for a product manufactured