BusyWaiting.cpp
Go to the documentation of this file.
1#include "BusyWaiting.h"
2
3#include <chrono>
4#include <thread>
5
7{
8
12
15 {
16 return SkillDescription{.skillId = SkillID{.skillName = "BusyWaiting"},
17 .description = "This skill takes two seconds",
18 .rootProfileDefaults = armarx::aron::make_dict(),
20 }
21
23 BusyWaitingSkill::main(const MainInput& in)
24 {
25 for (unsigned int i = 0; i < 10; i++)
26 {
28 std::this_thread::sleep_for(std::chrono::milliseconds(200));
29 }
30
31 return {TerminatedSkillStatus::Succeeded, nullptr};
32 }
33} // namespace armarx::skills::provider
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
void throwIfSkillShouldTerminate(const std::string &abortedMessage="") const
Definition Skill.cpp:389
static SkillDescription GetSkillDescription()
aron::data::DictPtr make_dict(_Args &&... args)
Definition Dict.h:107
A result struct for th main method of a skill.
Definition Skill.h:62