If this monitor does the same on another Mac (or possibly PC if it has the same connections), have your monitor repaired; If it's fine on another Mac, have your Mac repaired.
Alternatively: if this Mac does fine with another monitor, have your monitor repaired; if this Mac doesn't work even with another monitor, have your Mac repaired.
It's more likely to be a monitor issue than a Mac issue. So if you can't find out yourself, I'd take the monitor to your favorite shop for a test first.
I have a MacPro (Early 2009) 2.66 GHz Quad-Core Intel Xeon with 16 GB RAM, a NVIDIA GeForce GT 120 512 MB graphics card and a 24-inch Apple LED Cinema Display running OS 10.10.4. Yesterday my monitor started flickering. It did this for a while then returned to normal for the rest of the day. Today, it randomly flickers for a while, returns to normal for a while, then starts to flicker again. I have shut down the computer, disconnected and reconnected the display and restarted. The problem persists. What is the cause and how can I fix it?