Is this okay discipline?

If my son makes a mess he either gets the choice to help me with it or he sits in time out for the duration it takes me to clean it. Is this okay for an 18 months old?