In computing the length of service of any person entitled to the benefits of a pension or retirement annuity pursuant to this article, there shall be counted the time such person has served in a similar capacity with regard to his duties as an officer of any superseded court in the county, or that he may have served as a peace officer, as defined in the county and township peace officers’ pension or retirement act in the county. The service shall be continuous service as provided in such county or township peace officers’ pension or retirement act.