Stint, n.

A period of time during which one acted in some capacity or role.

I had a 2 year stint as editor-in-chief of the school newspaper.