Stint

meaning: a fixed or limited period of time spent doing a particular job or activity:

usage: He has just finished a stint of compulsory military service .