Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/Makefile.am	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 08:54:01 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Thu Mar 22 17:14:15 2018
-## Update Count     : 224
+## Last Modified On : Tue Mar 27 14:27:05 2018
+## Update Count     : 225
 ###############################################################################
 
@@ -46,5 +46,5 @@
 CC = ${abs_top_srcdir}/src/driver/cfa
 
-headers = fstream iostream iterator limits rational stdlib \
+headers = fstream iostream iterator limits rational time stdlib \
 	  containers/maybe containers/pair containers/result containers/vector
 
@@ -99,5 +99,4 @@
 	${stdhdr} 			\
 	math 				\
-	time 				\
 	gmp 				\
 	bits/align.h 		\
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/Makefile.in	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -150,6 +150,6 @@
 am__libcfa_d_a_SOURCES_DIST = libcfa-prelude.c interpose.c \
 	bits/debug.c fstream.c iostream.c iterator.c limits.c \
-	rational.c stdlib.c containers/maybe.c containers/pair.c \
-	containers/result.c containers/vector.c \
+	rational.c time.c stdlib.c containers/maybe.c \
+	containers/pair.c containers/result.c containers/vector.c \
 	concurrency/coroutine.c concurrency/thread.c \
 	concurrency/kernel.c concurrency/monitor.c assert.c \
@@ -165,5 +165,5 @@
 	libcfa_d_a-iostream.$(OBJEXT) libcfa_d_a-iterator.$(OBJEXT) \
 	libcfa_d_a-limits.$(OBJEXT) libcfa_d_a-rational.$(OBJEXT) \
-	libcfa_d_a-stdlib.$(OBJEXT) \
+	libcfa_d_a-time.$(OBJEXT) libcfa_d_a-stdlib.$(OBJEXT) \
 	containers/libcfa_d_a-maybe.$(OBJEXT) \
 	containers/libcfa_d_a-pair.$(OBJEXT) \
@@ -184,11 +184,12 @@
 libcfa_a_LIBADD =
 am__libcfa_a_SOURCES_DIST = libcfa-prelude.c interpose.c bits/debug.c \
-	fstream.c iostream.c iterator.c limits.c rational.c stdlib.c \
-	containers/maybe.c containers/pair.c containers/result.c \
-	containers/vector.c concurrency/coroutine.c \
-	concurrency/thread.c concurrency/kernel.c \
-	concurrency/monitor.c assert.c exception.c virtual.c \
-	concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \
-	concurrency/invoke.c concurrency/preemption.c
+	fstream.c iostream.c iterator.c limits.c rational.c time.c \
+	stdlib.c containers/maybe.c containers/pair.c \
+	containers/result.c containers/vector.c \
+	concurrency/coroutine.c concurrency/thread.c \
+	concurrency/kernel.c concurrency/monitor.c assert.c \
+	exception.c virtual.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
+	concurrency/alarm.c concurrency/invoke.c \
+	concurrency/preemption.c
 @BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \
 @BUILD_CONCURRENCY_TRUE@	concurrency/libcfa_a-thread.$(OBJEXT) \
@@ -197,6 +198,6 @@
 am__objects_6 = libcfa_a-fstream.$(OBJEXT) libcfa_a-iostream.$(OBJEXT) \
 	libcfa_a-iterator.$(OBJEXT) libcfa_a-limits.$(OBJEXT) \
-	libcfa_a-rational.$(OBJEXT) libcfa_a-stdlib.$(OBJEXT) \
-	containers/libcfa_a-maybe.$(OBJEXT) \
+	libcfa_a-rational.$(OBJEXT) libcfa_a-time.$(OBJEXT) \
+	libcfa_a-stdlib.$(OBJEXT) containers/libcfa_a-maybe.$(OBJEXT) \
 	containers/libcfa_a-pair.$(OBJEXT) \
 	containers/libcfa_a-result.$(OBJEXT) \
@@ -260,8 +261,8 @@
   esac
 am__nobase_cfa_include_HEADERS_DIST = fstream iostream iterator limits \
-	rational stdlib containers/maybe containers/pair \
+	rational time stdlib containers/maybe containers/pair \
 	containers/result containers/vector concurrency/coroutine \
 	concurrency/thread concurrency/kernel concurrency/monitor \
-	${shell find stdhdr -type f -printf "%p "} math time gmp \
+	${shell find stdhdr -type f -printf "%p "} math gmp \
 	bits/align.h bits/cfatime.h bits/containers.h bits/defs.h \
 	bits/debug.h bits/locks.h concurrency/invoke.h
@@ -419,5 +420,5 @@
 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
 AM_CCASFLAGS = @CFA_FLAGS@
-headers = fstream iostream iterator limits rational stdlib \
+headers = fstream iostream iterator limits rational time stdlib \
 	containers/maybe containers/pair containers/result \
 	containers/vector $(am__append_3)
@@ -435,5 +436,4 @@
 	${stdhdr} 			\
 	math 				\
-	time 				\
 	gmp 				\
 	bits/align.h 		\
@@ -612,4 +612,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-rational.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-stdlib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-time.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-virtual.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-assert.Po@am__quote@
@@ -623,4 +624,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-rational.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-time.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-virtual.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@bits/$(DEPDIR)/libcfa_a-debug.Po@am__quote@
@@ -787,4 +789,18 @@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-rational.obj `if test -f 'rational.c'; then $(CYGPATH_W) 'rational.c'; else $(CYGPATH_W) '$(srcdir)/rational.c'; fi`
 
+libcfa_d_a-time.o: time.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-time.o -MD -MP -MF $(DEPDIR)/libcfa_d_a-time.Tpo -c -o libcfa_d_a-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_d_a-time.Tpo $(DEPDIR)/libcfa_d_a-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='time.c' object='libcfa_d_a-time.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
+
+libcfa_d_a-time.obj: time.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-time.obj -MD -MP -MF $(DEPDIR)/libcfa_d_a-time.Tpo -c -o libcfa_d_a-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_d_a-time.Tpo $(DEPDIR)/libcfa_d_a-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='time.c' object='libcfa_d_a-time.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
+
 libcfa_d_a-stdlib.o: stdlib.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-stdlib.o -MD -MP -MF $(DEPDIR)/libcfa_d_a-stdlib.Tpo -c -o libcfa_d_a-stdlib.o `test -f 'stdlib.c' || echo '$(srcdir)/'`stdlib.c
@@ -1080,4 +1096,18 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-rational.obj `if test -f 'rational.c'; then $(CYGPATH_W) 'rational.c'; else $(CYGPATH_W) '$(srcdir)/rational.c'; fi`
+
+libcfa_a-time.o: time.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libcfa_a-time.o -MD -MP -MF $(DEPDIR)/libcfa_a-time.Tpo -c -o libcfa_a-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_a-time.Tpo $(DEPDIR)/libcfa_a-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='time.c' object='libcfa_a-time.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
+
+libcfa_a-time.obj: time.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libcfa_a-time.obj -MD -MP -MF $(DEPDIR)/libcfa_a-time.Tpo -c -o libcfa_a-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_a-time.Tpo $(DEPDIR)/libcfa_a-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='time.c' object='libcfa_a-time.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
 
 libcfa_a-stdlib.o: stdlib.c
Index: src/libcfa/concurrency/alarm.c
===================================================================
--- src/libcfa/concurrency/alarm.c	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/concurrency/alarm.c	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jun 2 11:31:25 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:35:18 2017
-// Update Count     : 1
+// Last Modified On : Tue Mar 27 14:12:11 2018
+// Update Count     : 41
 //
 
@@ -27,15 +27,7 @@
 
 
-static inline void ?{}( itimerval & this, __cfa_time_t * alarm ) with( this ) {
-	it_value.tv_sec = alarm->val / (1`cfa_s).val;			// seconds
-	it_value.tv_usec = max( (alarm->val % (1`cfa_s).val) / (1`cfa_us).val, 1000 ); // microseconds
-	it_interval.tv_sec = 0;
-	it_interval.tv_usec = 0;
-}
-
-static inline void ?{}( __cfa_time_t & this, timespec * curr ) {
-	uint64_t secs  = curr->tv_sec;
-	uint64_t nsecs = curr->tv_nsec;
-	this.val = from_s(secs).val + nsecs;
+static inline void ?{}( itimerval & this, Duration alarm ) with( this ) {
+	it_value   { alarm };								// seconds, microseconds
+	it_interval{ 0 };
 }
 
@@ -44,13 +36,12 @@
 //=============================================================================================
 
-__cfa_time_t __kernel_get_time() {
+Time __kernel_get_time() {
 	timespec curr;
-	clock_gettime( CLOCK_REALTIME, &curr );
-	return (__cfa_time_t){ &curr };
+	clock_gettime( CLOCK_MONOTONIC_RAW, &curr );		// CLOCK_REALTIME
+	return (Time){ curr };
 }
 
-void __kernel_set_timer( __cfa_time_t alarm ) {
-	itimerval val = { &alarm };
-	setitimer( ITIMER_REAL, &val, NULL );
+void __kernel_set_timer( Duration alarm ) {
+	setitimer( ITIMER_REAL, &(itimerval){ alarm }, NULL );
 }
 
@@ -59,5 +50,5 @@
 //=============================================================================================
 
-void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = 0`cfa_s, __cfa_time_t period = 0`cfa_s ) with( this ) {
+void ?{}( alarm_node_t & this, thread_desc * thrd, Time alarm, Duration period ) with( this ) {
 	this.thrd = thrd;
 	this.alarm = alarm;
@@ -68,5 +59,5 @@
 }
 
-void ?{}( alarm_node_t & this, processor   * proc, __cfa_time_t alarm = 0`cfa_s, __cfa_time_t period = 0`cfa_s ) with( this ) {
+void ?{}( alarm_node_t & this, processor   * proc, Time alarm, Duration period ) with( this ) {
 	this.proc = proc;
 	this.alarm = alarm;
Index: src/libcfa/concurrency/alarm.h
===================================================================
--- src/libcfa/concurrency/alarm.h	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/concurrency/alarm.h	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jun 2 11:31:25 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:59:27 2017
-// Update Count     : 3
+// Last Modified On : Mon Mar 26 16:25:41 2018
+// Update Count     : 11
 //
 
@@ -21,5 +21,5 @@
 #include <assert.h>
 
-#include "bits/cfatime.h"
+#include "time"
 
 struct thread_desc;
@@ -30,6 +30,6 @@
 //=============================================================================================
 
-__cfa_time_t __kernel_get_time();
-void __kernel_set_timer( __cfa_time_t alarm );
+Time __kernel_get_time();
+void __kernel_set_timer( Duration alarm );
 
 //=============================================================================================
@@ -38,6 +38,6 @@
 
 struct alarm_node_t {
-	__cfa_time_t alarm;		// time when alarm goes off
-	__cfa_time_t period;		// if > 0 => period of alarm
+	Time alarm;				// time when alarm goes off
+	Duration period;			// if > 0 => period of alarm
 	alarm_node_t * next;		// intrusive link list field
 
@@ -53,6 +53,6 @@
 typedef alarm_node_t ** __alarm_it_t;
 
-void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = 0`cfa_s, __cfa_time_t period = 0`cfa_s );
-void ?{}( alarm_node_t & this, processor   * proc, __cfa_time_t alarm = 0`cfa_s, __cfa_time_t period = 0`cfa_s );
+void ?{}( alarm_node_t & this, thread_desc * thrd, Time alarm, Duration period );
+void ?{}( alarm_node_t & this, processor   * proc, Time alarm, Duration period );
 void ^?{}( alarm_node_t & this );
 
Index: src/libcfa/concurrency/kernel
===================================================================
--- src/libcfa/concurrency/kernel	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/concurrency/kernel	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 09:58:39 2017
-// Update Count     : 2
+// Last Modified On : Fri Mar 23 17:08:20 2018
+// Update Count     : 3
 //
 
@@ -19,5 +19,5 @@
 
 #include "invoke.h"
-#include "bits/cfatime.h"
+#include "time"
 
 extern "C" {
@@ -49,8 +49,8 @@
 
 	// Preemption rate on this cluster
-	__cfa_time_t preemption_rate;
+	Duration preemption_rate;
 };
 
-extern __cfa_time_t default_preemption();
+extern Duration default_preemption();
 
 void ?{} (cluster & this);
Index: src/libcfa/concurrency/preemption.c
===================================================================
--- src/libcfa/concurrency/preemption.c	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/concurrency/preemption.c	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Feb  9 16:38:13 2018
-// Update Count     : 14
+// Last Modified On : Tue Mar 27 11:28:51 2018
+// Update Count     : 24
 //
 
@@ -27,8 +27,8 @@
 
 #if !defined(__CFA_DEFAULT_PREEMPTION__)
-#define __CFA_DEFAULT_PREEMPTION__ 10`cfa_ms
+#define __CFA_DEFAULT_PREEMPTION__ 10`ms
 #endif
 
-__cfa_time_t default_preemption() __attribute__((weak)) {
+Duration default_preemption() __attribute__((weak)) {
 	return __CFA_DEFAULT_PREEMPTION__;
 }
@@ -78,5 +78,5 @@
 
 // Get next expired node
-static inline alarm_node_t * get_expired( alarm_list_t * alarms, __cfa_time_t currtime ) {
+static inline alarm_node_t * get_expired( alarm_list_t * alarms, Time currtime ) {
 	if( !alarms->head ) return NULL;                          // If no alarms return null
 	if( alarms->head->alarm >= currtime ) return NULL;        // If alarms head not expired return null
@@ -88,5 +88,5 @@
 	alarm_node_t * node = NULL;                     // Used in the while loop but cannot be declared in the while condition
 	alarm_list_t * alarms = &event_kernel->alarms;  // Local copy for ease of reading
-	__cfa_time_t currtime = __kernel_get_time();    // Check current time once so we everything "happens at once"
+	Time currtime = __kernel_get_time();			// Check current time once so we everything "happens at once"
 
 	//Loop throught every thing expired
@@ -102,5 +102,5 @@
 
 		// Check if this is a periodic alarm
-		__cfa_time_t period = node->period;
+		Duration period = node->period;
 		if( period > 0 ) {
 			node->alarm = currtime + period;    // Alarm is periodic, add currtime to it (used cached current time)
@@ -117,9 +117,9 @@
 
 // Update the preemption of a processor and notify interested parties
-void update_preemption( processor * this, __cfa_time_t duration ) {
+void update_preemption( processor * this, Duration duration ) {
 	alarm_node_t * alarm = this->preemption_alarm;
 
 	// Alarms need to be enabled
-	if ( duration > 0 && !alarm->set ) {
+	if ( duration > 0 && ! alarm->set ) {
 		alarm->alarm = __kernel_get_time() + duration;
 		alarm->period = duration;
@@ -291,5 +291,5 @@
 // Used by thread to control when they want to receive preemption signals
 void ?{}( preemption_scope & this, processor * proc ) {
-	(this.alarm){ proc, 0`cfa_s, 0`cfa_s };
+	(this.alarm){ proc, (Time){ 0 }, 0`s };
 	this.proc = proc;
 	this.proc->preemption_alarm = &this.alarm;
@@ -301,5 +301,5 @@
 	disable_interrupts();
 
-	update_preemption( this.proc, 0`cfa_s );
+	update_preemption( this.proc, 0`s );
 }
 
Index: src/libcfa/concurrency/preemption.h
===================================================================
--- src/libcfa/concurrency/preemption.h	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/concurrency/preemption.h	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 22:34:25 2017
-// Update Count     : 1
+// Last Modified On : Fri Mar 23 17:18:53 2018
+// Update Count     : 2
 //
 
@@ -21,5 +21,5 @@
 void kernel_start_preemption();
 void kernel_stop_preemption();
-void update_preemption( processor * this, __cfa_time_t duration );
+void update_preemption( processor * this, Duration duration );
 void tick_preemption();
 
Index: src/libcfa/time
===================================================================
--- src/libcfa/time	(revision 6ecc079f66df192d98cedfc66c3766f9fc5704a8)
+++ src/libcfa/time	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -1,15 +1,15 @@
 // 
-// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
 //
 // The contents of this file are covered under the licence agreement in the
 // file "LICENCE" distributed with Cforall.
 // 
-// calendar -- 
+// time -- 
 // 
 // Author           : Peter A. Buhr
 // Created On       : Wed Mar 14 23:18:57 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 22 17:11:19 2018
-// Update Count     : 495
+// Last Modified On : Tue Mar 27 16:37:37 2018
+// Update Count     : 564
 // 
 
@@ -19,37 +19,40 @@
 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r5.html#refcc
 
-#include <time.h>
+#include <time.h>										// timespec
 extern "C" {
-#include <sys/time.h>
-int snprintf( char * buf, size_t size, const char * fmt, ... );
+#include <sys/time.h>									// timeval
 }
-#include <fstream>
-
-enum {
-	CLOCKGRAN = 15_000_000L,							// ALWAYS in nanoseconds, MUST BE less than 1 second
-	TIMEGRAN = 1_000_000_000L							// nanosecond granularity, except for timeval
-};
-
-
-#if defined( REALTIME_POSIX )
-#define tv_XSEC tv_nsec
-#else
-#define tv_XSEC tv_usec
-#endif
-
-
-#if defined( __linux__ )
-// fake a few things
-#define	CLOCK_REALTIME	0								// real (clock on the wall) time
-#endif
-
-// conversions for existing time types
+#include <iostream>										// istype/ostype
+
+enum { TIMEGRAN = 1_000_000_000L };						// nanosecond granularity, except for timeval
+
+
+//######################### timeval #########################
+
 static inline void ?{}( timeval & t ) {}
 static inline void ?{}( timeval & t, time_t sec ) { t.tv_sec = sec; t.tv_usec = 0; }
 static inline void ?{}( timeval & t, time_t sec, suseconds_t usec ) { t.tv_sec = sec; t.tv_usec = usec; }
+static inline void ?{}( timeval & t, zero_t ) { t.tv_sec = 0; t.tv_usec = 0; }
+static inline timeval ?=?( timeval & t, zero_t ) { return t{ 0 }; }
+static inline timeval ?+?( timeval & lhs, timeval rhs ) { return (timeval)@{ lhs.tv_sec + rhs.tv_sec, lhs.tv_usec + rhs.tv_usec }; }
+static inline timeval ?-?( timeval & lhs, timeval rhs ) { return (timeval)@{ lhs.tv_sec - rhs.tv_sec, lhs.tv_usec - rhs.tv_usec }; }
+static inline _Bool ?==?( timeval lhs, timeval rhs ) { return lhs.tv_sec == rhs.tv_sec && lhs.tv_usec == rhs.tv_usec; }
+static inline _Bool ?!=?( timeval lhs, timeval rhs ) { return lhs.tv_sec != rhs.tv_sec || lhs.tv_usec != rhs.tv_usec; }
+
+
+//######################### timespec #########################
 
 static inline void ?{}( timespec & t ) {}
 static inline void ?{}( timespec & t, time_t sec ) { t.tv_sec = sec; t.tv_nsec = 0; }
 static inline void ?{}( timespec & t, time_t sec, __syscall_slong_t nsec ) { t.tv_sec = sec; t.tv_nsec = nsec; }
+static inline void ?{}( timespec & t, zero_t ) { t.tv_sec = 0; t.tv_nsec = 0; }
+static inline timespec ?=?( timespec & t, zero_t ) { return t{ 0 }; }
+static inline timespec ?+?( timespec & lhs, timespec rhs ) { return (timespec)@{ lhs.tv_sec + rhs.tv_sec, lhs.tv_nsec + rhs.tv_nsec }; }
+static inline timespec ?-?( timespec & lhs, timespec rhs ) { return (timespec)@{ lhs.tv_sec - rhs.tv_sec, lhs.tv_nsec - rhs.tv_nsec }; }
+static inline _Bool ?==?( timespec lhs, timespec rhs ) { return lhs.tv_sec == rhs.tv_sec && lhs.tv_nsec == rhs.tv_nsec; }
+static inline _Bool ?!=?( timespec lhs, timespec rhs ) { return lhs.tv_sec != rhs.tv_sec || lhs.tv_nsec != rhs.tv_nsec; }
+
+
+//######################### C time #########################
 
 static inline char * ctime( time_t tp ) { char * buf = ctime( &tp ); buf[24] = '\0'; return buf; }
@@ -60,5 +63,4 @@
 static inline tm * localtime_r( time_t tp, tm * result ) { return localtime_r( &tp, result ); }
 
-
 //######################### Duration #########################
 
@@ -69,4 +71,6 @@
 static inline void ?{}( Duration & dur ) with( dur ) { tv = 0; }
 static inline void ?{}( Duration & dur, Duration d ) with( dur ) { tv = d.tv; }
+static inline void ?{}( Duration & dur, zero_t ) with( dur ) { tv = 0; }
+static inline Duration ?=?( Duration & dur, zero_t ) { return dur{ 0 }; }
 
 static inline void ?{}( Duration & dur, timeval t ) with( dur ) {
@@ -88,8 +92,74 @@
 } // ?=? timespec
 
+static inline int64_t nsecs( Duration dur ) with( dur ) { return tv; }
+
+static inline Duration +?( Duration rhs ) with( rhs ) {	return (Duration)@{ +tv }; }
+static inline Duration ?+?( Duration & lhs, Duration rhs ) { return (Duration)@{ lhs.tv + rhs.tv }; }
+static inline Duration ?+=?( Duration & lhs, Duration rhs ) { lhs = lhs + rhs; return lhs; }
+
+static inline Duration -?( Duration rhs ) with( rhs ) { return (Duration)@{ -tv }; }
+static inline Duration ?-?( Duration & lhs, Duration rhs ) { return (Duration)@{ lhs.tv - rhs.tv }; }
+static inline Duration ?-=?( Duration & lhs, Duration rhs ) { lhs = lhs - rhs; return lhs; }
+
+static inline Duration ?*?( Duration lhs, int64_t rhs ) { return (Duration)@{ lhs.tv * rhs }; }
+static inline Duration ?*?( int64_t lhs, Duration rhs ) { return (Duration)@{ lhs * rhs.tv }; }
+static inline Duration ?*=?( Duration & lhs, int64_t rhs ) { lhs = lhs * rhs; return lhs; }
+
+static inline Duration ?/?( Duration lhs, int64_t rhs ) { return (Duration)@{ lhs.tv / rhs }; }
+static inline int64_t ?/?( Duration lhs, Duration rhs ) { return lhs.tv / rhs.tv; }
+static inline Duration ?/=?( Duration & lhs, int64_t rhs ) { lhs = lhs / rhs; return lhs; }
+
+static inline Duration ?%?( Duration lhs, Duration rhs ) { return (Duration)@{ lhs.tv % rhs.tv }; }
+
+static inline _Bool ?==?( Duration lhs, Duration rhs ) { return lhs.tv == rhs.tv; }
+static inline _Bool ?!=?( Duration lhs, Duration rhs ) { return lhs.tv != rhs.tv; }
+static inline _Bool ?<? ( Duration lhs, Duration rhs ) { return lhs.tv <  rhs.tv; }
+static inline _Bool ?<=?( Duration lhs, Duration rhs ) { return lhs.tv <= rhs.tv; }
+static inline _Bool ?>? ( Duration lhs, Duration rhs ) { return lhs.tv >  rhs.tv; }
+static inline _Bool ?>=?( Duration lhs, Duration rhs ) { return lhs.tv >= rhs.tv; }
+
+static inline _Bool ?==?( Duration lhs, zero_t ) { return lhs.tv == 0; }
+static inline _Bool ?!=?( Duration lhs, zero_t ) { return lhs.tv != 0; }
+static inline _Bool ?<? ( Duration lhs, zero_t ) { return lhs.tv <  0; }
+static inline _Bool ?<=?( Duration lhs, zero_t ) { return lhs.tv <= 0; }
+static inline _Bool ?>? ( Duration lhs, zero_t ) { return lhs.tv >  0; }
+static inline _Bool ?>=?( Duration lhs, zero_t ) { return lhs.tv >= 0; }
+
+static inline Duration abs( Duration lhs ) { return lhs.tv >= 0 ? lhs : -lhs; }
+
+forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Duration dur );
+
+static inline Duration ?`ns( int64_t nsec  ) { return (Duration)@{ nsec }; }
+static inline Duration ?`us( int64_t usec  ) { return (Duration)@{ usec * (TIMEGRAN / 1_000_000L) }; }
+static inline Duration ?`ms( int64_t msec  ) { return (Duration)@{ msec * (TIMEGRAN / 1_000L) }; }
+static inline Duration ?`s ( int64_t sec   ) { return (Duration)@{ sec * TIMEGRAN }; }
+static inline Duration ?`s ( double  sec   ) { return (Duration)@{ sec * TIMEGRAN }; }
+static inline Duration ?`m ( int64_t min   ) { return (Duration)@{ min * (60L * TIMEGRAN) }; }
+static inline Duration ?`m ( double  min   ) { return (Duration)@{ min * (60L * TIMEGRAN) }; }
+static inline Duration ?`h ( int64_t hours ) { return (Duration)@{ hours * (3600L * TIMEGRAN) }; }
+static inline Duration ?`h ( double  hours ) { return (Duration)@{ hours * (3600L * TIMEGRAN) }; }
+static inline Duration ?`d ( int64_t days  ) { return (Duration)@{ days * (24L * 3600L * TIMEGRAN) }; }
+static inline Duration ?`d ( double  days  ) { return (Duration)@{ days * (24L * 3600L * TIMEGRAN) }; }
+static inline Duration ?`w ( int64_t weeks ) { return (Duration)@{ weeks * (7L * 24L * 3600L * TIMEGRAN) }; }
+static inline Duration ?`f ( int64_t fortnight ) { return (Duration)@{ fortnight * (14L * 24L * 3600L * TIMEGRAN) }; }
+
+static inline int64_t ?`ns ( Duration dur ) { return dur.tv; }
+static inline int64_t ?`us ( Duration dur ) { return dur.tv / (TIMEGRAN / 1_000_000L); }
+static inline int64_t ?`ms ( Duration dur ) { return dur.tv / (TIMEGRAN / 1_000L); }
+static inline int64_t ?`s  ( Duration dur ) { return dur.tv / TIMEGRAN; }
+static inline int64_t ?`m  ( Duration dur ) { return dur.tv / (60L * TIMEGRAN); }
+static inline int64_t ?`h  ( Duration dur ) { return dur.tv / (3600L * TIMEGRAN); }
+static inline int64_t ?`d  ( Duration dur ) { return dur.tv / (24L * 3600L * TIMEGRAN); }
+static inline int64_t ?`w  ( Duration dur ) { return dur.tv / (7L * 24L * 3600L * TIMEGRAN); }
+static inline int64_t ?`f  ( Duration dur ) { return dur.tv / (14L * 24L * 3600L * TIMEGRAN); }
+
+//------------------------- timeval (cont) -------------------------
+
 static inline void ?{}( timeval & t, Duration dur ) with( dur ) {
 	t.tv_sec = tv / TIMEGRAN;							// seconds
-	t.tv_usec = tv % TIMEGRAN / ( TIMEGRAN / 1000000L ); // microseconds
+	t.tv_usec = tv % TIMEGRAN / (TIMEGRAN / 1_000_000L); // microseconds
 } // ?{}
+
+//------------------------- timespec (cont) -------------------------
 
 static inline void ?{}( timespec & t, Duration dur ) with( dur ) {
@@ -98,69 +168,4 @@
 } // Timespec
 
-static inline int64_t nsecs( Duration dur ) with( dur ) { return tv; }
-
-static inline Duration +?( Duration rhs ) with( rhs ) {	return (Duration)@{ +tv }; }
-static inline Duration ?+?( Duration & lhs, Duration rhs ) { return (Duration)@{ lhs.tv + rhs.tv }; }
-static inline Duration ?+=?( Duration & lhs, Duration rhs ) { lhs = lhs + rhs; return lhs; }
-
-static inline Duration -?( Duration rhs ) with( rhs ) { return (Duration)@{ -tv }; }
-static inline Duration ?-?( Duration & lhs, Duration rhs ) { return (Duration)@{ lhs.tv - rhs.tv }; }
-static inline Duration ?-=?( Duration & lhs, Duration rhs ) { lhs = lhs - rhs; return lhs; }
-
-static inline Duration ?*?( Duration lhs, int64_t rhs ) { return (Duration)@{ lhs.tv * rhs }; }
-static inline Duration ?*?( int64_t lhs, Duration rhs ) { return (Duration)@{ lhs * rhs.tv }; }
-static inline Duration ?*=?( Duration & lhs, int64_t rhs ) { lhs = lhs * rhs; return lhs; }
-
-static inline Duration ?/?( Duration lhs, int64_t rhs ) { return (Duration)@{ lhs.tv / rhs }; }
-static inline int64_t ?/?( Duration lhs, Duration rhs ) { return lhs.tv / rhs.tv; }
-static inline Duration ?/=?( Duration & lhs, int64_t rhs ) { lhs = lhs / rhs; return lhs; }
-
-static inline Duration ?%?( Duration lhs, int64_t rhs ) { return (Duration)@{ lhs.tv % rhs }; }
-static inline int64_t ?%?( int64_t lhs, Duration rhs ) { return lhs % (rhs.tv / TIMEGRAN); }
-static inline int64_t ?%?( Duration lhs, Duration rhs ) { return lhs.tv % rhs.tv; }
-
-static inline _Bool ?==?( Duration lhs, Duration rhs ) { return lhs.tv == rhs.tv; }
-static inline _Bool ?!=?( Duration lhs, Duration rhs ) { return lhs.tv != rhs.tv; }
-static inline _Bool ?<?( Duration lhs, Duration rhs ) { return lhs.tv < rhs.tv; }
-static inline _Bool ?<=?( Duration lhs, Duration rhs ) { return lhs.tv <= rhs.tv; }
-static inline _Bool ?>?( Duration lhs, Duration rhs ) { return lhs.tv > rhs.tv; }
-static inline _Bool ?>=?( Duration lhs, Duration rhs ) { return lhs.tv >= rhs.tv; }
-
-static inline Duration abs( Duration lhs ) {
-	return lhs.tv >= 0 ? lhs : -lhs;
-} // abs
-
-static inline forall( dtype ostype | ostream( ostype ) )
-ostype & ?|?( ostype & os, Duration dur ) with( dur ) {
-	os | tv / TIMEGRAN;
-	char buf[16];
-	snprintf( buf, 16, "%09ld", ((tv < 0 ? -tv : tv) % TIMEGRAN) );
-	int i;
-	for ( i = 8; i >= 0 && buf[i] == '0' ; i -= 1 );	// find least significant digit
-	if ( i != -1 ) { buf[i + 1] = '\0';	os | '.' | buf; }
-	return os;
-}
-
-static inline Duration ?`ns( int64_t nsec ) { return (Duration)@{ nsec }; }
-static inline Duration ?`us( int64_t usec ) { return (Duration)@{ usec * (TIMEGRAN / 1_000l) }; }
-static inline Duration ?`ms( int64_t msec ) { return (Duration)@{ msec * (TIMEGRAN / 1_000_000l) }; }
-static inline Duration ?`s ( int64_t sec ) { return (Duration)@{ sec * TIMEGRAN }; }
-static inline Duration ?`s ( double  sec ) { return (Duration)@{ sec * TIMEGRAN }; }
-static inline Duration ?`m ( int64_t min ) { return (Duration)@{ min * (60L * TIMEGRAN) }; }
-static inline Duration ?`m ( double  min ) { return (Duration)@{ min * (60L * TIMEGRAN) }; }
-static inline Duration ?`h ( int64_t hours ) { return (Duration)@{ hours * (3600L * TIMEGRAN) }; }
-static inline Duration ?`h ( double  hours ) { return (Duration)@{ hours * (3600L * TIMEGRAN) }; }
-static inline Duration ?`d ( int64_t days ) { return (Duration)@{ days * (24L * 3600L * TIMEGRAN) }; }
-static inline Duration ?`d ( double  days ) { return (Duration)@{ days * (24L * 3600L * TIMEGRAN) }; }
-static inline Duration ?`w ( int64_t weeks ) { return (Duration)@{ weeks * (7L * 24L * 3600L * TIMEGRAN) }; }
-static inline Duration ?`f ( int64_t fortnight ) { return (Duration)@{ fortnight * (14L * 24L * 3600L * TIMEGRAN) }; }
-
-static inline int64_t ?`s ( Duration dur ) { return dur.tv / TIMEGRAN; }
-static inline int64_t ?`m ( Duration dur ) { return dur.tv / (60L * TIMEGRAN); }
-static inline int64_t ?`h ( Duration dur ) { return dur.tv / (3600L * TIMEGRAN); }
-static inline int64_t ?`d ( Duration dur ) { return dur.tv / (24L * 3600L * TIMEGRAN); }
-static inline int64_t ?`w ( Duration dur ) { return dur.tv / (7L * 24L * 3600L * TIMEGRAN); }
-static inline int64_t ?`f ( Duration dur ) { return dur.tv / (14L * 24L * 3600L * TIMEGRAN); }
-
 
 //######################### Time #########################
@@ -171,33 +176,5 @@
 };
 
-#ifdef __CFA_DEBUG__
-#define CreateFmt "Attempt to create Time( year=%d, month=%d, day=%d, hour=%d, min=%d, sec=%d, nsec=%d ), " \
-	"which exceeds range 00:00:00 UTC, January 1, 1970 to 03:14:07 UTC, January 19, 2038."
-#endif // __CFA_DEBUG__
-
-void mktime( Time & time, int year, int month, int day, int hour, int min, int sec, int nsec ) with( time ) {
-	tm tm;
-
-//	tzset();											// initialize time global variables
-	tm.tm_isdst = -1;									// let mktime determine if alternate timezone is in effect
-	tm.tm_year = year - 1900;							// mktime uses 1900 as its starting point
-	tm.tm_mon = month - 1;
-	tm.tm_mday = day;									// mktime uses range 1-31
-	tm.tm_hour = hour;
-	tm.tm_min = min;
-	tm.tm_sec = sec;
-	time_t epochsec = mktime( &tm );
-#ifdef __CFA_DEBUG__
-	if ( epochsec == (time_t)-1 ) {
-		abort( CreateFmt, year, month, day, hour, min, sec, nsec );
-	} // if
-#endif // __CFA_DEBUG__
-	tv = (int64_t)(epochsec) * TIMEGRAN + nsec;			// convert to nanoseconds
-#ifdef __CFA_DEBUG__
-	if ( tv > 2147483647LL * TIMEGRAN ) {				// between 00:00:00 UTC, January 1, 1970 and 03:14:07 UTC, January 19, 2038.
-		abort( CreateFmt, year, month, day, hour, min, sec, nsec );
-	} // if
-#endif // __CFA_DEBUG__
-} // mktime
+void mktime( Time & time, int year, int month, int day, int hour, int min, int sec, int nsec );
 
 static inline void ?{}( Time & t ) with( t ) {
@@ -205,43 +182,30 @@
 } // Time
 
-// These two constructors must not call mktime because it calls malloc. The malloc calls lead to recursion problems
-// because Time values are created from the sigalrm handler in composing the next context switch event.
-
-static inline void ?{}( Time & t, int sec ) with( t ) {
-#ifdef __CFA_DEBUG__
-	if ( tv < 0 || tv > 2147483647LL ) {				// between 00:00:00 UTC, January 1, 1970 and 03:14:07 UTC, January 19, 2038.
-	    abort( CreateFmt, 1970, 0, 0, 0, 0, sec, 0 );
-	} // if
-#endif // __CFA_DEBUG__
-	tv = (int64_t)sec * TIMEGRAN;
-} // Time
-
-static inline void ?{}( Time & t, int sec, int nsec ) with( t ) {
-#ifdef __U_DEBUG__
-	if ( tv < 0 || tv > 2147483647LL || nsec < 0 ) {	// between 00:00:00 UTC, January 1, 1970 and 03:14:07 UTC, January 19, 2038.
-	    abort( CreateFmt, 1970, 0, 0, 0, 0, sec, nsec );
-	} // if
-#endif // __U_DEBUG__
-	tv = (int64_t)sec * TIMEGRAN + nsec;
-} // Time
-
-static inline void ?{}( Time & time, int min, int sec, long int nsec ) {
-	mktime( time, 1970, 1, 1, 0, min, sec, nsec );
-} // Time
-
-static inline void ?{}( Time & time, int hour, int min, int sec, long int nsec ) {
-	mktime( time, 1970, 1, 1, hour, min, sec, nsec );
-} // Time
-
-static inline void ?{}( Time & time, int day, int hour, int min, int sec, long int nsec ) {
-	mktime( time, 1970, 1, day, hour, min, sec, nsec );
-} // Time
-
-static inline void ?{}( Time & time, int month, int day, int hour, int min, int sec, long int nsec ) {
-	mktime( time, 1970, month, day, hour, min, sec, nsec );
-} // Time
-
-static inline void ?{}( Time & time, int year, int month, int day, int hour, int min, int sec, long int nsec ) {
+static inline void ?{}( Time & time, int year, int month, int day, int hour, int min, int sec, int nsec ) {
 	mktime( time, year, month, day, hour, min, sec, nsec );
+} // Time
+
+static inline void ?{}( Time & time, int year, int month, int day, int hour, int min, int sec ) {
+	mktime( time, year, month, day, hour, min, sec, 0 );
+} // Time
+
+static inline void ?{}( Time & time, int year, int month, int day, int hour, int min ) {
+	mktime( time, year, month, day, hour, min, 0, 0 );
+} // Time
+
+static inline void ?{}( Time & time, int year, int month, int day, int hour ) {
+	mktime( time, year, month, day, hour, 0, 0, 0 );
+} // Time
+
+static inline void ?{}( Time & time, int year, int month, int day ) {
+	mktime( time, year, month, day, 0, 0, 0, 0 );
+} // Time
+
+static inline void ?{}( Time & time, int year, int month ) {
+	mktime( time, year, month, 0, 0, 0, 0, 0 );
+} // Time
+
+static inline void ?{}( Time & time, int year ) {
+	mktime( time, year, 0, 0, 0, 0, 0, 0 );
 } // Time
 
@@ -254,6 +218,9 @@
 } // Time
 
+static inline void ?{}( Time & t, zero_t ) { t.tv = 0; }
+static inline Time ?=?( Time & t, zero_t ) { return t{ 0 }; }
+
 static inline Time ?=?( Time & time, timeval t ) with( time ) {
-	tv = (int64_t)t.tv_sec * TIMEGRAN + t.tv_usec * 1000;
+	tv = (int64_t)t.tv_sec * TIMEGRAN + t.tv_usec * (TIMEGRAN / 1_000_000L);
 	return time;
 } // ?=?
@@ -273,6 +240,4 @@
 	t.tv_nsec = tv % TIMEGRAN;							// nanoseconds
 } // ?{}
-
-static inline int64_t nsec( Time time ) with( time ) { return tv; }
 
 static inline Time ?+?( Time & lhs, Duration rhs ) { return (Time)@{ lhs.tv + rhs.tv }; }
@@ -290,51 +255,23 @@
 static inline _Bool ?>=?( Time lhs, Time rhs ) { return lhs.tv >= rhs.tv; }
 
-static inline char * yymmd( Time time, char * buf ) with( time ) {
-	tm tm;
-	time_t s = tv / TIMEGRAN;
-	gmtime_r( &s, &tm );
-	snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_year % 99, tm.tm_mon, tm.tm_mday );
-	return buf;
-} // yymmd
-
-static inline char * mmyyd( Time time, char * buf ) with( time ) {
-	tm tm;
-	time_t s = tv / TIMEGRAN;
-	gmtime_r( &s, &tm );
-	snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mon, tm.tm_year % 99, tm.tm_mday );
-	return buf;
-} // yymmd
-
-static inline char * dmmyy( Time time, char * buf ) with( time ) {
-	tm tm;
-	time_t s = tv / TIMEGRAN;
-	gmtime_r( &s, &tm );
-	snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mday, tm.tm_mon, tm.tm_year % 99 );
-	return buf;
-} // yymmd
-
-static inline forall( dtype ostype | ostream( ostype ) )
-ostype & ?|?( ostype & os, Time time ) with( time ) {
-	char buf[32];										// at least 26
-	time_t s = tv / TIMEGRAN;
-	tm tm;
-	gmtime_r( &s, &tm );								// ctime_r adjusts for timezone
-	asctime_r( &tm, (char *)&buf );
-	buf[24] = '\0';										// remove trailing '\n'
-	long int ns = (tv < 0 ? -tv : tv) % TIMEGRAN;
-	if ( ns == 0 ) {
-		os | buf;
-	} else {
-		buf[19] = '\0';
-		os | buf;
-		char buf2[16];
-		snprintf( buf2, 16, "%09ld", ns );
-		int i;
-		for ( i = 8; i >= 0 && buf2[i] == '0' ; i -= 1 ); // find least significant digit
-		if ( i != -1 ) { buf2[i + 1] = '\0'; os | '.' | buf2; }
-		os | ' ' | &buf[20];
-	} // if
-	return os;
-} // ?|?
+char * yy_mm_dd( Time time, char * buf );
+static inline char * ?`ymd( Time time, char * buf ) {
+	return yy_mm_dd( time, buf );
+} // ymd
+
+char * mm_dd_yy( Time time, char * buf );
+static inline char * ?`mdy( Time time, char * buf ) {
+	return mm_dd_yy( time, buf );
+} // mdy
+
+char * dd_mm_yy( Time time, char * buf );
+static inline char * ?`dmy( Time time, char * buf ) {
+	return dd_mm_yy( time, buf );;
+} // dmy
+
+size_t strftime( char * buf, size_t size, const char * fmt, Time time );
+
+forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time );
+
 
 //######################### Clock #########################
@@ -346,9 +283,9 @@
 };
 
-void resetClock( Clock & clk ) with( clk ) {
-	clocktype = CLOCK_REALTIME;
+static inline void resetClock( Clock & clk ) with( clk ) {
+	clocktype = CLOCK_REALTIME_COARSE;
 } // Clock::resetClock
 
-void resetClock( Clock & clk, Duration adj ) with( clk ) {
+static inline void resetClock( Clock & clk, Duration adj ) with( clk ) {
 	clocktype = -1;
 	Duration tz = (timeval){ timezone, 0 };
@@ -356,19 +293,19 @@
 } // resetClock
 
-void ?{}( Clock & clk ) {
+static inline void ?{}( Clock & clk ) {
 	resetClock( clk );
 } // Clock
 
-void ?{}( Clock & clk, Duration adj ) {
+static inline void ?{}( Clock & clk, Duration adj ) {
 	resetClock( clk, adj );
 } // Clock
 
-Duration getRes() {
+static inline Duration getRes() {
 	struct timespec res;
-	clock_getres( CLOCK_REALTIME, &res );
+	clock_getres( CLOCK_REALTIME_COARSE, &res );
 	return (Duration){ res };
 } // getRes
 
-Time getTime() {
+static inline Time getTimeNsec() {						// with nanoseconds
 	timespec curr;
 	clock_gettime( CLOCK_REALTIME_COARSE, &curr );
@@ -376,17 +313,24 @@
 } // getTime
 
-Time getTime( Clock & clk ) with( clk ) {
+static inline Time getTime() {							// without nanoseconds
+	timespec curr;
+	clock_gettime( CLOCK_REALTIME_COARSE, &curr );
+	curr.tv_nsec = 0;
+	return (Time){ curr };
+} // getTime
+
+static inline Time getTime( Clock & clk ) with( clk ) {
 	return getTime() + offset;
 } // getTime
 
-Time ?()( Clock & clk ) with( clk ) {					// alternative syntax
+static inline Time ?()( Clock & clk ) with( clk ) {		// alternative syntax
 	return getTime() + offset;
 } // getTime
 
-timeval getTime( Clock & clk ) {
+static inline timeval getTime( Clock & clk ) {
 	return (timeval){ clk() };
 } // getTime
 
-tm getTime( Clock & clk ) with( clk ) {
+static inline tm getTime( Clock & clk ) with( clk ) {
 	tm ret;
 	localtime_r( getTime( clk ).tv_sec, &ret );
@@ -398,3 +342,2 @@
 // tab-width: 4 //
 // End: //
-
Index: src/libcfa/time.c
===================================================================
--- src/libcfa/time.c	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
+++ src/libcfa/time.c	(revision fae90d5f4e6f14db5c582aeb2a6ec9c0dbc21e73)
@@ -0,0 +1,138 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// time.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Tue Mar 27 13:33:14 2018
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Mar 27 16:37:35 2018
+// Update Count     : 18
+// 
+
+#include "time"
+#include <stdio.h>										// snprintf
+
+static char * nanomsd( long int ns, char * buf ) {		// most significant digits
+	snprintf( buf, 16, ".%09ld", ns );
+	int i;
+	for ( i = 9; buf[i] == '0' ; i -= 1 );				// find least significant digit
+	buf[i + 1] = '\0';
+	return buf;
+} // nanomsd
+
+
+//######################### Duration #########################
+
+
+forall( dtype ostype | ostream( ostype ) )
+ostype & ?|?( ostype & os, Duration dur ) with( dur ) {
+	os | tv / TIMEGRAN;									// print seconds
+	long int ns = (tv < 0 ? -tv : tv) % TIMEGRAN;		// compute nanoseconds
+	if ( ns != 0 ) {									// some ?
+		char buf[16];
+		os | nanomsd( ns, buf );						// print nanoseconds
+	} // if
+	return os;
+} // ?|?
+
+
+//######################### Time #########################
+
+
+#ifdef __CFA_DEBUG__
+#define CreateFmt "Attempt to create Time( year=%d (>=1970), month=%d (1-12), day=%d (1-31), hour=%d (0-23), min=%d (0-59), sec=%d (0-60), nsec=%d (0-999_999_999), " \
+	"which exceeds range 00:00:00 UTC, January 1, 1970 to 03:14:07 UTC, January 19, 2038."
+#endif // __CFA_DEBUG__
+
+void mktime( Time & time, int year, int month, int day, int hour, int min, int sec, int nsec ) with( time ) {
+	tm tm;
+
+	tm.tm_isdst = -1;									// let mktime determine if alternate timezone is in effect
+	tm.tm_year = year - 1900;							// mktime uses 1900 as its starting point
+#ifdef __CFA_DEBUG__
+	if ( month < 1 || 12 < month ) {
+		abort( CreateFmt, year, month, day, hour, (int)min, sec, nsec );
+	} // if
+#endif // __CFA_DEBUG__
+	tm.tm_mon = month - 1;								// mktime uses range 0-11
+#ifdef __CFA_DEBUG__
+	if ( day < 1 || 31 < day ) {
+		abort( CreateFmt, year, month, day, hour, (int)min, sec, nsec );
+	} // if
+#endif // __CFA_DEBUG__
+	tm.tm_mday = day;									// mktime uses range 1-31
+	tm.tm_hour = hour;
+	tm.tm_min = min;
+	tm.tm_sec = sec;
+	time_t epochsec = mktime( &tm );
+#ifdef __CFA_DEBUG__
+	if ( epochsec == (time_t)-1 ) {
+		abort( CreateFmt, year, month, day, hour, (int)min, sec, nsec );
+	} // if
+#endif // __CFA_DEBUG__
+	tv = (int64_t)(epochsec) * TIMEGRAN + nsec;			// convert to nanoseconds
+#ifdef __CFA_DEBUG__
+	if ( tv > 2147483647LL * TIMEGRAN ) {				// between 00:00:00 UTC, January 1, 1970 and 03:14:07 UTC, January 19, 2038.
+		abort( CreateFmt, year, month, day, hour, (int)min, sec, nsec );
+	} // if
+#endif // __CFA_DEBUG__
+} // mktime
+
+char * yy_mm_dd( Time time, char * buf ) with( time ) {
+	time_t s = tv / TIMEGRAN;
+	tm tm;
+	gmtime_r( &s, &tm );
+	snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_year % 99, tm.tm_mon + 1, tm.tm_mday );
+	return buf;
+} // yy_mm_dd
+
+char * mm_dd_yy( Time time, char * buf ) with( time ) {
+	time_t s = tv / TIMEGRAN;
+	tm tm;
+	gmtime_r( &s, &tm );
+	snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mon + 1, tm.tm_mday, tm.tm_year % 99 );
+	return buf;
+} // mm_dd_yy
+
+char * dd_mm_yy( Time time, char * buf ) with( time ) {
+	time_t s = tv / TIMEGRAN;
+	tm tm;
+	gmtime_r( &s, &tm );
+	snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mday, tm.tm_mon + 1, tm.tm_year % 99 );
+	return buf;
+} // dd_mm_yy
+
+size_t strftime( char * buf, size_t size, const char * fmt, Time time ) with( time ) {
+	time_t s = tv / TIMEGRAN;
+	tm tm;
+	gmtime_r( &s, &tm );
+	return strftime( buf, size, fmt, &tm );
+} // strftime
+
+forall( dtype ostype | ostream( ostype ) )
+ostype & ?|?( ostype & os, Time time ) with( time ) {
+	char buf[32];										// at least 26
+	time_t s = tv / TIMEGRAN;
+    ctime_r( &s, (char *)&buf );						// 26 characters: "Wed Jun 30 21:49:08 1993\n"
+	buf[24] = '\0';										// remove trailing '\n'
+	long int ns = (tv < 0 ? -tv : tv) % TIMEGRAN;		// compute nanoseconds
+	if ( ns == 0 ) {									// none ?
+		os | buf;										// print date/time/year
+	} else {
+		buf[19] = '\0';									// truncate to "Wed Jun 30 21:49:08"
+		os | buf;										// print date/time
+		char buf2[16];
+		nanomsd( ns, buf2 );							// compute nanoseconds
+		os | buf2 | ' ' | &buf[20];						// print nanoseconds and year
+	} // if
+	return os;
+} // ?|?
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
