Trying to get object to blink (speed acording to timer)

I’m trying to get a cube object to blink by using renderer.enabled, and have the speed it blinks be measured by a timer. For example the red coins in Mario games. I want it to slowly start to blink faster as it gets closer to the time limit i have set up. Anyone know the best way to go about it?

'Best is always open to interpretation, but here is some starter code:

using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour {

	public float time = 30.0f;
	public float maxInterval = 1.2f;
	public float minInterval = 0.2f;
	
	private float interval = 1.0f;
	private float timer    = 30.0f;
	
	void Start() {
		timer = time;
	}
	
	void Update () {
		interval = minInterval + timer / time * (maxInterval - minInterval);
		timer -= Time.deltaTime;
		if (timer < 0.0f) timer = 0.0f; 
		renderer.enabled = Mathf.PingPong(Time.time, interval) > (interval / 2.0f);
	}
}

Perhaps something like:

blinkSpeed = startSpeed + totalSpeedIncrease * timeElapsed / maxTimeElapsed; // blink speeds measured in blinks per second

t += Time.deltaTime * blinkSpeed;
if (t >= 1)
{
    t = 0;
    // switch renderer.enabled
}