]>
Commit | Line | Data |
---|---|---|
bd6521f0 A |
1 | // |
2 | // SleepAction.cpp | |
3 | // kdprof | |
4 | // | |
5 | // Created by James McIlree on 4/17/13. | |
6 | // Copyright (c) 2013 Apple. All rights reserved. | |
7 | // | |
8 | ||
9 | #include "global.h" | |
10 | ||
11 | void SleepAction::execute(Globals& globals) { | |
12 | uint64_t nanos = _time.value(); | |
13 | struct timespec ts; | |
14 | ts.tv_sec = decltype(ts.tv_sec)(nanos / NANOSECONDS_PER_SECOND); | |
15 | ts.tv_nsec = decltype(ts.tv_sec)(nanos - ts.tv_sec * NANOSECONDS_PER_SECOND); | |
16 | nanosleep(&ts, NULL); | |
17 | } |