Danny Reece Jerman, 27, of Chapel Lane, Galgate, Lancaster, was seen acting suspiciously in a car on January 27, 2018, and was later found to be in possession of cannabis.
At the time Jerman, who admitted possessing cannabis with intent to supply it, was still on a prison licence from another offence, and was on police bail awaiting his sentencing for drug driving.
But the length of time that has passed since this offence had to be factored in to his eventual sentencing at Preston Crown Court.
Judge Philip Parry remarked the two year delay in prosecuting Jerman was "broadly as a result of insufficient resources or manpower within the police."
He added: "The enormous delay has benefited the defendant.
"I'm not so sure it benefits society at large, but that's not his fault.
"He will be the happy beneficiary today of what I consider to be an unjustified delay in bringing this to court."
His comments came after a senior detective gave a written explanation to the court citing one of the investigating officers had had a personal issue, and although it was referred to another officer, Lancaster CID had experienced a year of "unprecedented demand" last year, and simply did not have the resources to deal with the case.
Prosecuting, Peter Barr said: " At about 8.30pm on a Saturday, the police in an area of Lancaster University have been alerted by a coach driver that a red car driven by this defendant was acting suspiciously on the campus.
"The police decided to go. They stopped the car and it was a red Peugeot.
"The car smelled of cannabis. The police explained they would search the car and following that search a silver bag was found under the passenger seat."
The court heard the bag contained 27.64g cannabis in bags, weighing scales, and £310.72 cash - all of which have been forfeited under the Misuse of Drugs Act.
Jerman's mobile phone was seized and an analysis uncovered incriminating texts asking him to supply drugs on the campus.
At first Jerman denied knowledge of the bag and even blamed his passenger - who has since been cleared.
Defending, Rachel Woods said in the time since the offence he had turned his back on drug dealing to concentrate on his family.
Judge Parry added: "Over four or five days you was a cannabis dealer for hire.
"On this occasion you happened to be cruising around a campus - that was a ready source of custom for you."
He imposed 12 months in prison, suspended for 12 months, with 200 hours of unpaid work.