func (d *Document) SetRefreshRate(dur time.Duration) {
	d.mu.Lock()
	defer d.mu.Unlock()
	d.refreshRate = dur
}
SetRefreshRate sets the rate at which output is rendered.
package glint
import (
	"context"
	"io"
	"os"
	"sync"
	"time"
	"github.com/mitchellh/go-glint/flex"
)
type Document struct {
	mu          sync.Mutex
	r           Renderer
	els         []Component
	refreshRate time.Duration
	prevRoot    *flex.Node
	mounted     map[ComponentMounter]struct{}
	paused      bool
	closed      bool
}
func New() *Document {
	var d Document
	d.SetRenderer(&TerminalRenderer{
		Output: os.Stdout,
	})
	return &d
}
func (d *Document) SetRenderer(r Renderer) {
	d.mu.Lock()
	defer d.mu.Unlock()
	d.r = r
}