how long before a fresh chilli pepper is cooked?
You can certainly eat fresh chili raw, so no need to worry about killing anything (give it a rinse first).  It depends on the effect you are after.  Typically, "at the end of cooking" means to turn off the heat and add the ingredient.