(a) When any prisoner has been sentenced to imprisonment in a county workhouse or jail or is serving time in the county jail or workhouse pursuant to an agreement with the department of correction, the sheriff or superintendent of the county shall be authorized to permit the prisoner to participate in work programs.
(b) Work performed by the prisoner under this section shall be credited toward reduction of the prisoner’s sentence in the following manner: for each one (1) day worked on such duties by the prisoner the sentence shall be reduced by two (2) days.