any bugs in following code?
package tools

import (
	"sync"
	"time"

	"code.byted.org/gopkg/logs"
	"github.com/NAME_1/NAME_2/cpu"
	"github.com/NAME_1/NAME_2/mem"

	"code.byted.org/pdi-qa/commons-util/atomich"
)

// Limiter limits the request speed if cpu or memory usage is too high.
type Limiter struct {
	CpuUsage float64
	MemUsage float64

	memu    float64
	cpuu    float64
	stopCh  chan interface{}
	started bool
	mu      sync.Mutex
}

func (l *Limiter) Start() {
	l.mu.Lock()

	if l.started {
		return
	}

	l.stopCh = make(chan interface{})
	go func() {
		for {
			select {
			case <-l.stopCh:
				break
			default:
				atomich.StoreFloat64(&l.cpuu, cpuPercent())
				atomich.StoreFloat64(&l.memu, memPercent())
				time.Sleep(1 * time.Second)
			}
		}
	}()
	l.started = true
	logs.Infof("limiter started")
}

func (l *Limiter) Stop() {
	l.mu.Lock()
	if !l.started {
		return
	}

	l.stopCh <- struct{}{}
	close(l.stopCh)
	l.started = false

	l.mu.Unlock()
	logs.Infof("limiter stopped")
}

func cpuPercent() float64 {
	pers, err := cpu.Percent(0, false)
	if err != nil {
		logs.Errorf("failed to get cpu, err:%v", err)
		return 0
	}
	if len(pers) == 0 {
		return 0
	}

	return pers[0]
}

func memPercent() float64 {
	v, err := mem.VirtualMemory()
	if err != nil {
		logs.Errorf("failed to get mem, err:%v", err)
		return 0
	}
	return v.UsedPercent
}

func (l *Limiter) Limit(fn func()) {
	for {
		mem := atomich.LoadFloat64(&l.memu)
		if l.MemUsage > 0 && mem > 0 && l.MemUsage < mem {
			time.Sleep(100 * time.Millisecond)
			continue
		}
		cpu := atomich.LoadFloat64(&l.cpuu)
		if l.CpuUsage > 0 && cpu > 0 && l.CpuUsage < cpu {
			time.Sleep(100 * time.Millisecond)
			continue
		}
		break
	}
	fn()
}