Choosing the right oscillator

What you mentioned may be very useful, can you put a code as an example ?