Routine

The generic term for a function or procedure.