Melvin, an 11-year D.C. police veteran, lay sprawled across three yellow cushioned chairs in a dingy witness room at D.C. Superior Court. His partner was stretched out on a desk nearby. Both were fast asleep. They had completed their overnight tour of duty and were scheduled to testify in court one recent morning.

After checking in first at court at 7:30 a.m., Melvin had gone home and picked up his wife and daughter, dropped off his daughter at the baby sitter's and his wife at work, ate breakfast and lunch, watched the goings and comings in the court corrider, deposited some money in the credit union and slept. For his 7 1/2 hours of waiting to testify, he was paid $120 in overtime pay. He never set foot in the courtroom.

Al, a 13-year D.C. police veteran, was playing cards with a buddy in a lounge in the courthouse, waiting to testify in a murder trial. It was his second trial in two weeks. The previous week he had spent nine hours a day for five days, waiting to testify in a rape trial. For the murder trial, he was in the courthouse for 25 hours, most of it spent playing cards. For his waiting, he was paid $1,075 in overtime pay for the two trials. He never set foot in the courtroom in either case.

"Ninety-eight percent of the time is spent waiting," said Al, who like Melvin asked not to be fully identified. "In all my years of coming to court, I have never spent an hour on the witness stand." Nevertheless, he said he averages between $5,000 and $6,000 annually in overtime pay for court appearances.

Melvin and Al are just two of the nearly 1,500 officers who pass through the city's court system each week. They come to testify at hearings and trials, to confer with prosecutors and to present evidence to support arrests. But because of the enormous logjam of daily court cases, they spend most of their time waiting to be heard. While they wait, they sleep, play cards, stand around in the court corridors, run personal errands -- and get paid.

Last fiscal year alone, police spent $249,485 hours in court, 69 percent of it during off-duty hours. They were paid $1.4 million, enough to hire 62 new teachers in the city's school system. Seventy-five percent of the annual overtime budget for the police department is spent on court time.

"There is a lot of waste of money over there," acknowledges Larry Melton, vice president of the International Brotherhood of Police Officers Local 442, which represents the police officers.

"There is no easy way of getting police officers in here to prosecute a case and save money at the same time," said Inspector Fred Thomas, head of the court liaison office, which monitors police officers in court. "It's a mammoth problem."

Mammoth or not, many rank-and-file police officers privately acknowledge they take advantage of the present system in which the judges of Superior Court routinely schedule far more cases on their individual calendars than they are likely to hear each day.

Also, there is little effort by the judges to schedule hearings and court appearances when individual officers are on regular dayside duty -- as several other local jurisdictions do -- so that they can be paid at straight-time rates rather than overtime.

Judges at Superior Court, including Chief Judge H. Carl Moultrie I, refused to comment when asked about the scheduling system.

Police officers are not the only witnesses paid to spend time in court, Civilians and specialized expert witnesses also are paid for court appearances.They are paid a set fee. Police officers, however, are paid differently.

Under a law passed by Congress in 1965, a police officer reporting to court in his off-duty hours is paid overtime, at time and a half, except in those cases in which he is appearing for the first time. If it is his first time and his day off, he is giving compensatory time. If it is his regular day work, he receives his straight time pay. Otherwise, he is paid overtime.

"It's an imcentive for the officer to go out there and beat the bushes [make arrests]," said union official Melton. "Before they put the program in, a lot of guys wouldn't go out there and beat the bushes. If you are not getting paid anything, why go out there and beat the bushes? You don't ask the brick layer to lay bricks on his own time."

Some officers complain that because of what they say is their low pay -- the average police salary here is $21,564 a year -- they are forced to use overtime to help make their house payments, buy groceries, take vactions and cover other costs. One police official said some officers use court overtime as "a second job."

Along the way, some officers have abused the system. One officer was fired after he made up false cases in order to collect overtime pay in court. Another officer was disciplined after he was discovered shopping while being paid for a scheduled appearance in court.

"The abuses that exist are minimal," said Inspector Thomas. But he added, "There is no way you can plug every leak in the dam. Many officers have learned to take advantage of the system. What they are doing is not illegal."

One detective, who formerly worked a permanent day shift in the criminal investigations division at police headquarters downtown, recently transferred to an outlying district station house so he could be on rotating shifts. He wanted this so that when he periodically work night duty, he said, he would be paid overtime for court apearances during regular daytime hours.

Al, a stocky detective, works a permanent overnight shift, from 11 p.m. to 7 a.m. Recently, he reported to court after his shift. "I spent the day in court and left about 5 p.m.," he said. "I got home and in bed by about 6 p.m., and slept until 9:30 p.m.," when he said he got up to get ready to report back to work. "It's not bad," he said. Of course, you try to get a little sleep while sitting around the courthouse.

Al said he tries not to make more than $6,000 a year in overtime because he doesn't want to become too dependent on it. "There are some guys who make $32,000 to $34,000 a year just because of the overtime," he said. "They're killing themselves. I try not to do that. If you do, you find yourself making arrest just so you can go to court to collect that overtime."

Melvin also works the overnight shift. As he leaned against the wall in the courthouse witness room recently, his hands behind his head and his feet propped up in a chair, he said, "They are paying me $16 an hour to sit here. I make more money than the sergeant. I don't want to make sergeant."

Even under the best of circumstances, it is not possible to arrange all court appearances during an officer's regular duty hours. But some local jurisdictions make a stab at it.

In Montgomery County, for example, officers appearing in court for traffic violations automatically schedule the court date on their day work shift. Detectives who are to appear for trials rearrange their work schedules around the trial date so they will be working days when the trial takes place. The county spent $197,030 in overtime pay last year for court time for its 710-member police force.

In Philadelphia, which has a 7,500-member police force, more than twice the size of the D.C. force, about $4 million was spent on court overtime pay to officers according to a survey prepared for the Police Foundation. The city also has set up some unique provisions under its court-time law. For example, if an officer reports to court in his off-duty hours and spends only one hour there, he has an option of working the rest of the eight-hour tour of duty or overtime pay. Also, when possible, officers waiting to testify are assigned to patrol the central city area near the courthouse until they are called to testify.

According to D.C. Police Deputy Chief Isaac Fulwood, head of the department's financial management and budget office, the number of hours police officers spend in court here has been reduced -- down from 366,183 two years ago to 249,485 hours last year.

Fulwood said officials are trying to reduce the hours still further, but there are many problems, especially the heavy court docket.

Sometimes judges schedule up to 15 trials on one day, and all the witnesses, including police officers, must be there to testify, court officials said. Theoretically, the judge may hear only one case, but he will not decide which case until he has talked with the attorneys that morning to determine who is ready.

"The courts [judges] are just so unpredictable," said one official. "Then you have these judges who take a holier-than-thou approach and want people there when they ask for them and not a minute later. They don't want to wait 30 minutes so you can call an officer or witness to court. They want them there now and that's it."

Despite the compensation for court time, some police officers said they prefer not to come to court on their off-duty hours. "I want to be off on my off-days," said one robbery detective. "I tell the prosecutors to try to set the court dates for my day work. When I am off, I don't want to be coming down here. I have other things to do. Even if I sit waiting for a case, just the waiting is draining."