It depends Hannah. If you're doing a 10k and never run over 10k in training, then a lengthy warm up is probably out!
I generally aim for a 3 mile warm up for races up to 10k. 2 miles gentle, half a mile progressing slowly up to race pace, then half a mile with 5 short strides.
You will get different answers from everyone on here about the length of a warm up - the key is to find what works for you.
In training, I rarely aim for any quality work until I've got a couple of miles under my belt, and I never worry about pace for the first 2 miles.