Пример #1
0
        public static Instruction Create(int duration)
        {
            Scale(ref duration, Unit);
            if (duration >= 1 << 10)
            {
                return(Failed.OutOfRange);
            }
            var ins = new AsmWait_Standard();

            ins.Duration = duration;
            return(ins);
        }
Пример #2
0
        public static Instruction Create(int duration)
        {
            if (duration < 0)
            {
                return(AsmEmpty.Create());
            }
            var ins = AsmWait_HighPrecision.Create(duration);

            if (ins.Success)
            {
                return(ins);
            }
            ins = AsmWait_Standard.Create(duration);
            if (ins.Success)
            {
                return(ins);
            }
            return(AsmWait_Extended.Create(duration));
        }