The time it takes for a commitment depends on you, your income and assets, and your credit, as well as the lender / broker and the underwriter. There's no hard and fast rule as each file is different, and each has to be weighed on their merits. Some can take just a few days after submission of all documents, while others can take weeks.
Basically, the cleaner the file (i.e., great credit, lower debt-to-income ratios, higher down payments, and everything documented, it can take just a few days.
However, the worse the credit scores, the higher the debt-to-income ratios, the lower the down payment, and the more items that require explanations and/or need resolution, then it can take well over a week if not 2 or 3 or more.