$ltimer already exists to provide this (although it's not set until after the /timer command).