http://english.stackexchange.com/questions/454650/ddg#454656
The earliest Elephind match for "dollars to doughnuts" is from "Nevada Items," in the Sacramento [California] Daily Union (October 27, 1875):
P. K. Mason, the chap who was arrested at Eureka the other day for stealing a watch and chain from the Antelope lodging house, has been bound over in the sum of $200 to answer before the Grand Jury upon a charge of grand larceny. The evidence against him was conclusive, in regard to taking the watch, but the Sentinel thinks if he states to the jury that he needed it to take medicine by, it's dollars to doughnuts he will be acquitted.
The sense of the phrase "it's dollars to doughnuts" here seems to be "it's very likely." To judge from Christine Ammer, The American Heritage Dictionary of Idioms, second edition (2013), the meaning of the expression has remained essentially unchanged over the ensuing 143 years since its appearance in the Sacramento Daily Union:
dollars to doughnuts, it's. It's a virtual certainty, as in It's dollars to doughnuts that the team will make the playoffs. This metaphoric term pits dollars against doughnuts as in a bet. {Colloquial; late 1800s}
The underlying idea is that you wouldn't bet something valuable (like dollars) against something very inexpensive (like doughnuts, which presumably were a dime a dozen—if that—at the time) unless you had a very high degree of confidence that you would win the bet.
--Sven Yargs
Latency is accounted for in the sync process