diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-04 15:43:26 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-04 15:43:26 -0500 |
commit | 005115e1da60fee3ee01d320fe1de4645cc95bfd (patch) | |
tree | 020f0a557656ff3c3cf7b6ad9286ec85b8df9cf8 /src | |
parent | 1a9b44a9c6ba2b6c089e1ec73905d117b9e25714 (diff) |
change to nanosecond resolution time accounting
Diffstat (limited to 'src')
-rw-r--r-- | src/litmus.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/litmus.c b/src/litmus.c index 6503088..4666471 100644 --- a/src/litmus.c +++ b/src/litmus.c | |||
@@ -27,14 +27,16 @@ task_class_t str2class(const char* str) | |||
27 | return -1; | 27 | return -1; |
28 | } | 28 | } |
29 | 29 | ||
30 | #define NS_PER_MS 1000000 | ||
31 | |||
30 | int sporadic_task(unsigned long e, unsigned long p, | 32 | int sporadic_task(unsigned long e, unsigned long p, |
31 | int cpu, task_class_t cls) | 33 | int cpu, task_class_t cls) |
32 | { | 34 | { |
33 | struct rt_task param; | 35 | struct rt_task param; |
34 | param.exec_cost = e; | 36 | param.exec_cost = e * NS_PER_MS; |
35 | param.period = p; | 37 | param.period = p * NS_PER_MS; |
36 | param.cpu = cpu; | 38 | param.cpu = cpu; |
37 | param.cls = cls; | 39 | param.cls = cls; |
38 | return set_rt_task_param(gettid(), ¶m); | 40 | return set_rt_task_param(gettid(), ¶m); |
39 | } | 41 | } |
40 | 42 | ||