Package timer

import "github.com/chaos-mesh/chaos-mesh/test/pkg/timer"

Overview ▾

type TimeResult

TimeResult represents a get time result with an error

type TimeResult struct {
    Time  *time.Time
    Error error

type Timer

Timer represents a running timer process

type Timer struct {
    Stdin    io.WriteCloser
    TimeChan chan TimeResult
    // contains filtered or unexported fields

func StartTimer

func StartTimer() (*Timer, error)

StartTimer will start a timer process

func (*Timer) GetTime

func (timer *Timer) GetTime() (*time.Time, error)

GetTime will run `time.Now()` in timer

func (*Timer) Pid

func (timer *Timer) Pid() int

Pid returns the pid of timer

func (*Timer) Stop

func (timer *Timer) Stop() error

Stop stops the process