Edibles require longer to function because they must pass through the gastrointestinal tract before being taken into the blood, but cannabis that is inhaled is taken into the blood system nearly instantly.
The duration edibles stay in your body is also affected by this variation in intake. Since edibles must be processed, there is a 2-hour delay between ingestion and getting high, which is why most folks prefer to smoke marijuana rather than consume edibles.
If we talk about baked foods and such as sweets and chocolates, they melt in your mouth but are more digestible, they may enable Marijuana to enter the blood more efficiently.