It's different for everyone. What you want to do is time eating for when insulin starts browning active.
Also depends on your insulin, but I'll assume a fast acting one (Novorapid for example).
So I would start injecting just before eating. Then measure your results, if your bg goes higher that 8-10 then you may need to inject a bit earlier before eating.
But it also depends on what you're 3stimg at the time, different foods raise your bg higher or lower. Something rich in sugars (sweets) will raise you quicker than something rich in starch (potatoes). But then if you eat a lot of fat with the meal (pizza with lots of cheese), that will slow down the food too!
You just have to experiment! There sadly isn't one answer that works for everyone.