Try turning on v-sync.
If that doesn't work, turning triple buffer on will fix it, but at the expense of a little control lag.
I don't think the speed of your system makes a difference, but I'm no expert.
I believe it's just caused by a difference in the refresh rate of your monitor vs what MAME is sending.