c++/rgb-assembler/commands/Sleep.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 23 Dec 2017 23:42:46 +0100
changeset 22 cb2055cdc2f0
parent 20 c++/rgb-assembler/commands/Goto.h@b9ceffdcaf14
child 29 10d6964e7b4a
permissions -rw-r--r--
SLEEP in class
     1 #pragma once
     2 
     3 #include <wchar.h>
     4 #include <chrono>
     5 #include <thread>
     6 
     7 #include "../Command.h"
     8 
     9 using namespace std;
    10 
    11 namespace commands {
    12 
    13 class Sleep : public Command {
    14 public:
    15 
    16 	void process(octet_t* memory, address_t& index) override {
    17 		sleep_t delay = read<sleep_t>(memory, index);
    18 		wprintf(L"SLEEP %*d ms\n", 4, delay);
    19 		this_thread::sleep_for(chrono::milliseconds(delay));
    20 	}
    21 private:
    22 
    23 };
    24 
    25 }