Index: kernel/generic/include/cpu.h
===================================================================
--- kernel/generic/include/cpu.h	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/include/cpu.h	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -72,7 +72,11 @@
 	size_t missed_clock_ticks;
 	
+	/**
+	 * Processor cycle accounting.
+	 */
 	bool idle;
-	uint64_t idle_ticks;
-	uint64_t busy_ticks;
+	uint64_t last_cycle;
+	uint64_t idle_cycles;
+	uint64_t busy_cycles;
 	
 	/**
Index: kernel/generic/include/sysinfo/abi.h
===================================================================
--- kernel/generic/include/sysinfo/abi.h	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/include/sysinfo/abi.h	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -69,6 +69,6 @@
 	bool active;             /**< CPU is activate */
 	uint16_t frequency_mhz;  /**< Frequency in MHz */
-	uint64_t idle_ticks;     /**< Number of idle kernel quanta */
-	uint64_t busy_ticks;     /**< Number of busy kernel quanta */
+	uint64_t idle_cycles;    /**< Number of idle cycles */
+	uint64_t busy_cycles;    /**< Number of busy cycles */
 } stats_cpu_t;
 
Index: kernel/generic/src/cpu/cpu.c
===================================================================
--- kernel/generic/src/cpu/cpu.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/src/cpu/cpu.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -49,4 +49,5 @@
 #include <print.h>
 #include <sysinfo/sysinfo.h>
+#include <arch/cycle.h>
 
 cpu_t *cpus;
@@ -94,4 +95,9 @@
 	CPU->tlb_active = true;
 	
+	CPU->idle = false;
+	CPU->last_cycle = get_cycle();
+	CPU->idle_cycles = 0;
+	CPU->busy_cycles = 0;
+	
 	cpu_identify();
 	cpu_arch_init();
Index: kernel/generic/src/interrupt/interrupt.c
===================================================================
--- kernel/generic/src/interrupt/interrupt.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/src/interrupt/interrupt.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -99,4 +99,6 @@
 void exc_dispatch(unsigned int n, istate_t *istate)
 {
+	ASSERT(CPU);
+	
 #if (IVT_ITEMS > 0)
 	ASSERT(n < IVT_ITEMS);
@@ -109,4 +111,14 @@
 		irq_spinlock_unlock(&THREAD->lock, false);
 	}
+	
+	/* Account CPU usage if it has waked up from sleep */
+	irq_spinlock_lock(&CPU->lock, false);
+	if (CPU->idle) {
+		uint64_t now = get_cycle();
+		CPU->idle_cycles += now - CPU->last_cycle;
+		CPU->last_cycle = now;
+		CPU->idle = false;
+	}
+	irq_spinlock_unlock(&CPU->lock, false);
 	
 	uint64_t begin_cycle = get_cycle();
Index: kernel/generic/src/proc/scheduler.c
===================================================================
--- kernel/generic/src/proc/scheduler.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/src/proc/scheduler.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -193,11 +193,9 @@
 		 * This improves energy saving and hyperthreading.
 		 */
-		
-		 /* Mark CPU as it was idle this clock tick */
 		irq_spinlock_lock(&CPU->lock, false);
 		CPU->idle = true;
 		irq_spinlock_unlock(&CPU->lock, false);
-		
 		interrupts_enable();
+		
 		/*
 		 * An interrupt might occur right now and wake up a thread.
@@ -386,5 +384,5 @@
 	as_t *old_as = AS;
 	
-	ASSERT(!THREAD || irq_spinlock_locked(&THREAD->lock));
+	ASSERT((!THREAD) || (irq_spinlock_locked(&THREAD->lock)));
 	ASSERT(CPU != NULL);
 	
Index: kernel/generic/src/sysinfo/stats.c
===================================================================
--- kernel/generic/src/sysinfo/stats.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/src/sysinfo/stats.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -124,6 +124,6 @@
 		stats_cpus[i].active = cpus[i].active;
 		stats_cpus[i].frequency_mhz = cpus[i].frequency_mhz;
-		stats_cpus[i].busy_ticks = cpus[i].busy_ticks;
-		stats_cpus[i].idle_ticks = cpus[i].idle_ticks;
+		stats_cpus[i].busy_cycles = cpus[i].busy_cycles;
+		stats_cpus[i].idle_cycles = cpus[i].idle_cycles;
 		
 		irq_spinlock_unlock(&cpus[i].lock, true);
Index: kernel/generic/src/time/clock.c
===================================================================
--- kernel/generic/src/time/clock.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ kernel/generic/src/time/clock.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -57,4 +57,5 @@
 #include <mm/frame.h>
 #include <ddi/ddi.h>
+#include <arch/cycle.h>
 
 /* Pointer to variable with uptime */
@@ -125,4 +126,13 @@
 }
 
+static void cpu_update_accounting(void)
+{
+	irq_spinlock_lock(&CPU->lock, false);
+	uint64_t now = get_cycle();
+	CPU->busy_cycles += now - CPU->last_cycle;
+	CPU->last_cycle = now;
+	irq_spinlock_unlock(&CPU->lock, false);
+}
+
 /** Clock routine
  *
@@ -136,11 +146,6 @@
 	size_t missed_clock_ticks = CPU->missed_clock_ticks;
 	
-	/* Account lost ticks to CPU usage */
-	if (CPU->idle)
-		CPU->idle_ticks += missed_clock_ticks + 1;
-	else
-		CPU->busy_ticks += missed_clock_ticks + 1;
-	
-	CPU->idle = false;
+	/* Account CPU usage */
+	cpu_update_accounting();
 	
 	/*
@@ -151,5 +156,8 @@
 	size_t i;
 	for (i = 0; i <= missed_clock_ticks; i++) {
+		/* Update counters and accounting */
 		clock_update_counters();
+		cpu_update_accounting();
+		
 		irq_spinlock_lock(&CPU->timeoutlock, false);
 		
Index: uspace/app/tasks/tasks.c
===================================================================
--- uspace/app/tasks/tasks.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ uspace/app/tasks/tasks.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -165,8 +165,8 @@
 	for (i = 0; i < count; i++) {
 		if (cpus[i].active) {
-			printf("cpu%u: %" PRIu16 " MHz, busy ticks: "
-			    "%" PRIu64 ", idle ticks: %" PRIu64 "\n",
-			    cpus[i].id, cpus[i].frequency_mhz, cpus[i].busy_ticks,
-			    cpus[i].idle_ticks);
+			printf("cpu%u: %" PRIu16 " MHz, busy cycles: "
+			    "%" PRIu64 ", idle cycles: %" PRIu64 "\n",
+			    cpus[i].id, cpus[i].frequency_mhz, cpus[i].busy_cycles,
+			    cpus[i].idle_cycles);
 		} else {
 			printf("cpu%u: inactive\n", cpus[i].id);
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ uspace/app/top/screen.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -222,8 +222,16 @@
 	for (i = 0; i < data->cpus_count; i++) {
 		if (data->cpus[i].active) {
-			printf("cpu%u (%4" PRIu16 " MHz): busy ticks: "
-			    "%" PRIu64 ", idle ticks: %" PRIu64,
+			uint64_t busy;
+			uint64_t idle;
+			char busy_suffix;
+			char idle_suffix;
+			
+			order_suffix(data->cpus[i].busy_cycles, &busy, &busy_suffix);
+			order_suffix(data->cpus[i].idle_cycles, &idle, &idle_suffix);
+			
+			printf("cpu%u (%4" PRIu16 " MHz): busy cycles: "
+			    "%" PRIu64 "%c, idle cycles: %" PRIu64 "%c",
 			    data->cpus[i].id, data->cpus[i].frequency_mhz,
-			    data->cpus[i].busy_ticks, data->cpus[i].idle_ticks);
+			    busy, busy_suffix, idle, idle_suffix);
 			puts(", idle: ");
 			print_percent(data->cpus_perc[i].idle, 2);
Index: uspace/app/top/top.c
===================================================================
--- uspace/app/top/top.c	(revision 5954241521e2d445f3a765e39e6475e956edc93f)
+++ uspace/app/top/top.c	(revision d0c82c531ddd91c5c32e571f69768c044cf234b2)
@@ -175,5 +175,5 @@
 	}
 	
-	/* For each CPU: Compute total ticks and divide it between
+	/* For each CPU: Compute total cycles and divide it between
 	   user and kernel */
 	
@@ -181,7 +181,7 @@
 	for (i = 0; i < new_data->cpus_count; i++) {
 		uint64_t idle =
-		    new_data->cpus[i].idle_ticks - old_data->cpus[i].idle_ticks;
+		    new_data->cpus[i].idle_cycles - old_data->cpus[i].idle_cycles;
 		uint64_t busy =
-		    new_data->cpus[i].busy_ticks - old_data->cpus[i].busy_ticks;
+		    new_data->cpus[i].busy_cycles - old_data->cpus[i].busy_cycles;
 		uint64_t sum = idle + busy;
 		
