I can't work out how the samples obtain the frame rate??

I can get it myself using timers but thats somewhat messy. Could somebody explain to me how this is done please?