Depending on the substance(s) in question, one could probably dose up just before going on duty, with the stuff kicking in whilst actually on duty. Or, if easily concealable, take it while on duty.
We usually get tested on arrival on the property. I’ve heard it suggested that some testing should occur during the workday, or even when going off duty, to catch those who would partake while on duty.