In every criminal case the clerk of the circuit court in which the accused is found guilty or is placed on probation during deferral of the proceedings pursuant to § 16.1-278.8, 16.1-278.9, 18.2-61, 18.2-67.1, 18.2-67.2, 18.2-251, 19.2-298.02, 19.2-303.2, or 19.2-303.6 or, if the conviction is in a district court, the clerk to which the judge thereof certifies as aforesaid, shall, as soon as may be, make up a statement of all the expenses incident to the prosecution, including such as are certified under § 19.2-335, and execution for the amount of such expenses shall be issued and proceeded with. Chapter 21 (§ 19.2-339 et seq.) shall apply thereto in like manner as if, on the day of completing the statement, there was a judgment in such court in favor of the Commonwealth against the accused for such amount as a fine. However, in any case in which an accused waives trial by jury, at least 10 days before trial, but the Commonwealth or the court trying the case refuses to so waive, then the cost of the jury shall not be included in such statement or judgment recorded pursuant to § 17.1-275.5.
Va. Code § 19.2-336