When I lived and worked in Saudi Arabia as a lawyer from 2010 to 2012, I spent a lot of time waiting outside restaurants. Not because I really like food, or had a fetish for restaurant exteriors, but because I was really bad at estimating when Salat would happen.

“Salat” is the Arabic word for the prayer time that Muslims are asked to perform five times a day. During the usual workday, Salat occurs about four times. In most countries, Salat is voluntary. Saudi Arabia is not most countries.

In the oil-rich monarchy, all businesses are required to shut down during Salat to give their employees enough time to go to a local mosque and pray. During the 1980s, if Saudi’s religious police caught a young Muslim outside during Salat, they’d literally drag him to a mosque.

In the white-collar economy, each Salat normally takes 15 minutes, because fancy office buildings usually have designated prayer rooms where employees can go.

However, in most of the service industry (restaurants, gas stations, shops, etc.), businesses could be closed between 30 minutes and one hour at a time, to give their workers enough time to shut down, walk to the mosque, walk back, and open up again. Or, as was more often the case, to give their employees enough time to go hang out somewhere, have a few cigarettes, and complain about their bosses.

Salat happens at different times every day, so the primary problem during the years I spent as an attorney in the country’s tech sector was knowing exactly when Salat was going to occur. A difficult task, since different business would close or open at different times depending on their relative fear of the religious police.

Businesses that were frequently targeted by the religious police, or that had employees who were particularly religious (and thus likely to report Salat infractions), might close early or wait until the last religious police patrol had rolled by to open back up.

As a result, I spent a lot of time in my car, wishing I had a better air conditioner, waiting for Salat to be over. Which got me wondering: How much does all this cost the Saudi economy?

The cost of Salat

Since each Salat takes 30 minutes to an hour, and there are four Salats during the normal eight- to 12-hour workday, we can conclude that most (if not all) of the entire Saudi economy shuts down for somewhere between one and four hours each day for Salat.

In other words, on top of lunch, smoke breaks, Facebooking, holidays, and other forms of time off, about 10 to 45 percent of the average worker’s day isn’t spent working. It’s spent in Salat.

If you wanted to make a quick, rough estimate of the cost of Salat, you could take Saudi’s GDP (about $1.7 trillion per year) and multiply that by the approximate average time of the normal workday that is spent in prayer (say, 30 percent) — which comes to about $510 billion per year.

But such an estimate would be on the high side. In reality, Salat’s primary impact is on the consumer-facing side of the service sector — restaurants, gas stations, etc. — which have to close down for the longest period of time and rely the most on human labor.

However, even if one were to build a more reasonable calculation that minimized the impact of Salat on the Saudi economy, the cost would still be immensely high. Even excluding all oil exports and looking solely at the service sector, the loss from Salat would still be more than $120 billion per year.

Which is a lot of money. The entire global video game industry is around $99 billion per year. The US cinema industry? About $11 billion.

However, Salat isn’t the only religious restriction costing the Saudi economy money. There’s also a host of gender restrictions that could cost the Saudi economy more than $80 billion per year.

It’s hard to hire a woman in Saudi Arabia. And that’s kind of the point.

After my time as a lawyer, I was offered a job with one of the largest tech investment groups in the Middle East, whose head offices were in the Saudi capital, Riyadh. They wanted me to serve on their executive board and head up the legal department there in Riyadh. I was very excited.

My first act was to start hiring people into my department. And being young, idealistic, and cost-conscious, I decided the best option was to hire a Saudi female lawyer.

That wasn’t simply because of some youthful hope of empowering women in the kingdom, but also because I saw what economists call a "neglected resource." Specifically, there weren’t many firms in Saudi Arabia that hired women at the time, but the ones that did all told me that their Saudi female trainees and associates “cost less than the male associates and worked twice as hard.”

From the perspective of most of my Saudi female friends, the reason they worked so much harder than men was simple economics: There were far fewer jobs for women, so when they finally got one, they often felt they had to work twice as hard to prove themselves.

Additionally, for many women, work life was their way out of home situations that were often far from ideal. Many of my female friends in the kingdom would frequently tell me about how they would use almost any excuse to spend extra hours in the office, where they were fairly free, in order to avoid going home to mahrams — male relatives (normally a brother or father) who were legally in control of their lives. Saudi women cannot travel — even locally — without their mahrams' permission, and many often live under curfews set by their mahrams.

Unfortunately, it quickly became pretty evident that unless my name had the title of "prince" attached to it, it was going to be nearly impossible for me to hire any women to work for me.

First, due to Saudi’s strict gender-segregation laws, if I hired a female attorney, her office would have to be two floors down from mine on the other side of a digitally encoded security door. So if I wanted to give her a set of documents to run over to one of the government ministries, I would have to call her, tell her to wait by the door, walk down two flights of stairs, and slip the documents under the door. Not exactly efficient by any stretch of the imagination.

Second, due to limitations on the freedom of women to talk to men they are unrelated to, it was fairly unclear whether women could actually go to government ministries to handle paperwork. For me, that was the bigger problem, as that was the primary thing I needed an associate to do for me.

Saudi Arabia, like many countries in the Middle East, has a bloated government workforce that largely exists to ensure that the population remains loyal, compliant, and paid off. It’s basically a clunky form of wealth redistribution. However, for most businesspeople in Saudi Arabia, the large government workforce means every process is burdened by endless line waiting and bureaucracy.

To illustrate just how bad the bureaucracy is in Saudi Arabia, there is literally a job of “moaqib,” which essentially translates to “professional line waiter.” These are people who have no real training or education but are really good at waiting or shoving their way to the front of the line at government ministries. Most of the time, I’d outsource dealing with bureaucratic red tape to these types of services, but sometimes I’d need an actual lawyer to go on my behalf.

And while there was no official rule against women going to the ministries, according to everyone I spoke to, eventually someone in those gigantic workforces of bureaucrats would start rejecting or delaying my paperwork because I had sent a woman instead of a man.

So I folded my dreams of creating a workforce of women and hired two Saudi men — one of whom only showed up for work about half the time.

The cost of the gender gap

In economic terms, human labor is a resource. People need to be hired, trained, etc., but once those steps are accomplished, the more labor you have, the more your economy grows.

According to the World Bank, Saudi Arabia’s current female labor participation rate is around 21 percent — which is about 8 percent lower than what the labor participation was for women in the US in 1948.

As scholars Isobel Coleman and Aala Abdelgadir note in the book Women and Girls Rising, a 2012 report from the International Labor Organization (ILO) estimated that if countries in the Middle East and North Africa were to reduce the gender gap in workforce participation rates by 20 percentage points (from 50.6 to 30.6 percent) from 2012 to 2017, the region’s GDP could grow by $415 billion.

Saudi Arabia’s economy makes up about 20 percent of the total GDP of that region. Which means that if Saudi Arabia could reduce its female employment gap to rates similar to those found in US more than 50 years ago, it could potentially increase its GDP by somewhere between $80 billion and $100 billion.

Foreign consultants and diplomats have for years pushed the Saudi government to reform the country’s economy and increase female employment. The most recent effort resulted in Saudi’s “Vision 2030” plan, which aims to raise female employment to 30 percent.

However, while 30 percent female employment could theoretically be attained by increasing the quantity of lower-paid and retail jobs for women (which is the primary focus of Saudi reform efforts), it is extremely unlikely that female employment will progress very far beyond those levels, or that women will be able to obtain higher-paid work, so long as Saudi Arabia’s extensive system of gender-based religious restrictions remains in place.

The country’s religious restrictions make it nearly impossible for employers to hire women without a substantial drop in efficiency. It doesn’t matter how much job training for women the Saudi state provides if employers are still required to install special holding cells for their female employees. Thus, it's fair to assume that the total cost of Saudi’s gender restrictions will remain near $80 billion per year regardless of its “Vision 2030.”

Saudi leaders want to build a different kind of economy. Here’s why they can’t.

According to the CIA World Factbook, oil and gas accounts for nearly 90 percent of Saudi Arabia's export earnings. In other words, the country doesn’t really do much other than produce oil, mostly via an oil company (ARAMCO) that was started by Americans 80 years ago and is still heavily run by American managers.

(Notably, ARAMCO is one of the only successful companies in Saudi Arabia — and, like the country’s only other internationally recognizable company, Kingdom Holding Company, it is not forced to comply with many of the country’s religious restrictions.)

Part of the reason Saudi Arabia has been unable to diversify its economy is because of the “natural resource curse,” which is when a country finds it cheaper and more profitable to invest in extracting a natural resource, like oil (which Saudi Arabia produces for less than $10 per barrel), than to do something “hard” like teaching its population how to program software or build entrepreneurial ventures.

However, the natural resource curse is only one part of why Saudi Arabia has failed to diversify its economy. Its religious restrictions have also significantly disadvantaged the country in the long term.

It is simply much, much harder to create new industries in the service sector when you lose 30 percent of your employees’ time to Salat. It is nearly impossible to find a decent quantity of qualified skilled workers when half of your workforce (i.e., women) is forced to sit at home because they cannot talk to men, drive, or go to government ministries.

Put bluntly, when one combines the cost of Salat with the cost of Saudi’s gender restrictions, the total cost to the economy is probably well over $200 billion per year, at minimum. Money that could have been used to diversify the Saudi economy and create new opportunities beyond oil.

I’m not saying anything here that Saudis themselves don’t already know. Most of my friends in the Saudi business community loathe the country's religious restrictions.

Unfortunately, it remains unclear whether any of Saudi’s leaders have the political will to change Saudi’s religious restrictions before the country hits a true financial crisis — which may occur over the next several years, as the value of oil exports drop and domestic consumption of oil and energy in Saudi continues to increase.

Ryan Riegg is a member of the California Bar, the author of several law journal articles on Islamic law, and the founder of the Lawyerence of Arabia writing group. He is currently based in the Balkans.