Imports System.Threading

Namespace UTSModule.Test.Command.SystemCommand
    Public Class DelayMsExecutor
        Inherits TestCommandExecutor


        Sub New(command As TestCommand)
            MyBase.New(command)

            CommandReturn.LowerLimit = "True"

            CommandReturn.UpperLimit = "True"

            CommandReturn.RecordValue = String.Empty

            CommandReturn.ExecuteResultTipString = String.Empty

            CommandReturn.ExecuteResult = True
        End Sub


        Public Overrides Function Execute() As TestCommandReturn
            Dim sleepTime As Integer = CInt(TestCommand.Parameter(0))

            Thread.Sleep(sleepTime)

            CommandReturn.ExecuteResult = True
            CommandReturn.RecordValue = "True"
            CommandReturn.ExecuteResultTipString = $"成功延时 {sleepTime} ms"

            Return CommandReturn
        End Function
    End Class
End Namespace