Uniformed police officers routinely crowd the hallways of the Criminal Justice Center, sitting on benches reading or looking at their phones as they wait to testify. Others are in small anterooms outside courtrooms, chatting with colleagues or preparing with prosecutors.

The pay meter is running all the while.

In the first seven months of fiscal year 2018, which ends June 30, police officers racked up $12 million in overtime related to testifying — or just waiting to testify — in court. That's one of the biggest reasons, with five months remaining in the fiscal year, the Police Department had already burned through its entire $57 million overtime budget.

The department is not alone. The Pennsylvania Intergovernmental Cooperation Authority (PICA), the city's fiscal watchdog board, estimates that the city is on pace to spend $30 million more than its $135 million overtime budget for fiscal year 2018. The Sheriff's Office and Fire and Streets Departments are among those expected to go over budget.

But Police Department overtime has garnered the most attention during early City Council hearings on the next fiscal year's budget. PICA is also considering a study into reducing police overtime expenses, with a particular focus on the role of officers' court time.

"One of our largest drivers of overtime is preliminary hearings because officers are required to come to [court] for those hearings," Brian Abernathy, first deputy managing director, said during a budget hearing last week. "Part of the conversation with the courts is to see whether they would be willing to have some preliminary hearings back in the districts, which would in fact reduce overtime significantly. But again that's a longer conversation."

During an editorial board meeting with the Inquirer and Daily News last month, Police Commissioner Richard Ross said he has spoken to District Attorney Larry Krasner about the possibility of moving preliminary hearings back to six regional police districts, as was done until 2010 — a step that could cut down on the time officers spend just getting to and from hearings, and out of their districts. (Most of the hearings occur at one of three Center City locations: City Hall, the Criminal Justice Center, or Family Court.)

"He said he's not opposed to it, but of course we have to go to the judges and public defender and see if they aren't opposed," Ross said.

The judges, through a spokesman for the First Judicial District, declined to answer questions on the issue.

"The courts have no control over police overtime," spokesman Marty O'Rourke said.

Harvey Rice, PICA's executive director, said that when he met with court personnel last summer about police overtime, they pointed the finger at police and the District Attorney's Office. The Kenney administration and the District Attorney's Office also pointed fingers.

"That meeting got very contentious and heated in regards to who was responsible for court overtime and what measures needed to be put in place that could help alleviate that," Rice said in an interview last week.

Rice plans to ask the PICA board at its April meeting to hire a consultant to study police overtime. Based on the meetings PICA staff has had with officials so far about court-related police overtime, he said several issues came up that should be studied further.

For example, Rice said, officers appearing in court used to check in and out with a fingerprint system, but now, court liaisons, often police officers on temporary desk duty, sign subpoenaed officers in and out — a potentially less precise method.

Rice also said some judges reported some police officers' request to be called last to testify, therefore prolonging their time on the clock.

Then there is the disagreement on scheduling. Rice said that both the First Judicial District  and District Attorney's Office said that the Police Department's schedule is coordinated with the case processing system and that officers are not generally asked to appear when to do so would conflict with their work schedule.

But police officers said their work schedules hardly coincide with required court appearances.

Whoever is at fault, it doesn't matter to the officers getting the extra money.

One who recently was waiting to be called in a trial said he had been sitting outside the room for the better part of a week. Even if he never took the stand, he cracked to a court officer during a break one day, at least he'd be able to afford a new pair of snakeskin boots.

Payroll records indicate that the Police Department's largest overtime earners are generally detectives, many of whom earn tens of thousands of dollars each year on top of their salaries. In 2017, according to payroll records, seven detectives each earned more than $75,000 in overtime. In 2016, five of the city's 10 highest overtime earners were detectives; it was not clear how much of that extra pay was tied to court appearances.

One homicide detective, who declined to be identified without department authorization, said the money reflects the workload most investigators shoulder. Homicide detectives often work extended shifts after being assigned a new murder investigation, and after they spend time in court for cases they previously helped to build, many return to the unit to continue investigating their open cases.

"You can't put a price on staying [at work] and clearing [an investigation]," he said.

John McNesby, president of Fraternal Order of Police Lodge 5, the officers' union, said the cops who earn lots of overtime are generally the ones who work long hours and make a lot of arrests, which results in more court notices to testify.

"The more active you are, the more overtime you're going to make," McNesby said.

Court time drives about 20 percent of police overtime spending. An additional $45 million in overtime has already been put toward crime fighting, security details, protests, and special events. (At least $13 million is expected to be reimbursed by private entities that requested police presence.)

It is unclear how much money would be saved if preliminary hearings were held in the districts.

"We do not have a targeted reduction at this point because, again, the system is not just us, it's also the district attorney, it's also the courts," Abernathy said. "We need to be able to advance that conversation further down the road before we can identify exactly what those savings will be."

One thing is for sure: The city doesn't expect police costs to decrease in fiscal year 2019, Budget Director Anna Adams said.