summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2009-02-24 03:01:48 +0100
committerNeal H. Walfield <neal@gnu.org>2009-02-24 03:01:48 +0100
commit1b9c502bdfb2edda3aef870a8b6e2b378ba2095b (patch)
treec053626ad8a79876a3616cce80459c91b4351843
parent0faf5b60cf8e42214d38d05eefe342de011f381f (diff)
Keep time in milliseconds.
-rw-r--r--viengoos/scheduler.c4
-rw-r--r--viengoos/thread.c2
-rw-r--r--viengoos/thread.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/viengoos/scheduler.c b/viengoos/scheduler.c
index 9a145b0..210bdc7 100644
--- a/viengoos/scheduler.c
+++ b/viengoos/scheduler.c
@@ -28,7 +28,7 @@
#define SHOW_THREAD_STATE_TRANSITIONS 5
/* 100 milliseconds. */
-#define TS (100 * 1000 * 1000)
+#define TS (100 * 1000)
struct thread *current_thread;
/* When CURRENT_THREAD was scheduled. */
@@ -72,7 +72,7 @@ deschedule_current_thread (bool suspend)
assert (current_thread->state == THREAD_RUNNING
|| current_thread->state == THREAD_SUSPENDED);
- int delta = time_data.ns_since_boot - quantum_start;
+ int delta = (time_data.ns_since_boot - quantum_start) / 1000;
current_thread->time -= delta;
current_thread->total_time += delta;
if (suspend || current_thread->state == THREAD_SUSPENDED)
diff --git a/viengoos/thread.c b/viengoos/thread.c
index cf7ea40..6fb3517 100644
--- a/viengoos/thread.c
+++ b/viengoos/thread.c
@@ -76,7 +76,7 @@ thread_dump (int argc, char *argv[])
"utcb: "VG_CAP_FMT"\n"
"\n"
"state: %d\n"
- "time: %d ns (last payout at %ld.%09ld s)\n"
+ "time: %d ms (last payout at %ld.%09ld s)\n"
"total time: %ld.%09ld s\n"
"\n"
"last fault:\n",
diff --git a/viengoos/thread.h b/viengoos/thread.h
index a1826ac..f251491 100644
--- a/viengoos/thread.h
+++ b/viengoos/thread.h
@@ -93,7 +93,7 @@ struct thread
enum thread_state state;
struct list_node run_queue_node;
- /* The amount of time, in nanoseconds, allocated to this thread. */
+ /* The amount of time, in milliseconds, allocated to this thread. */
int time;
uint64_t last_payout;
uint64_t total_time;