Index: src/Common/Stats/Base.h
===================================================================
--- src/Common/Stats/Base.h	(revision 1bb9a9a31ea68de9c74a5cd408849eadfdf24745)
+++ src/Common/Stats/Base.h	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -16,4 +16,7 @@
 #pragma once
 
+#include <cstdint>
+#include <iostream>
+
 namespace Stats {
 	namespace Base {
@@ -28,5 +31,5 @@
 
 		template<typename func_t>
-		void ForAll(TreeTop & range, size_t level, func_t func, bool destroy = false);
+		void ForAll(TreeTop & range, std::size_t level, func_t func, bool destroy = false);
 
 		class TreeImpl {
@@ -46,5 +49,5 @@
 
 			template<typename func_t>
-			friend void ForAll(TreeTop & range, size_t level, func_t func, bool destroy);
+			friend void ForAll(TreeTop & range, std::size_t level, func_t func, bool destroy);
 		};
 
@@ -56,5 +59,5 @@
 
 		template<typename func_t>
-		inline void ForAll(TreeTop & range, size_t level, func_t func, bool destroy) {
+		inline void ForAll(TreeTop & range, std::size_t level, func_t func, bool destroy) {
 			auto it = range.head;
 			while(it) {
Index: src/Common/Stats/Stats.cc
===================================================================
--- src/Common/Stats/Stats.cc	(revision 1bb9a9a31ea68de9c74a5cd408849eadfdf24745)
+++ src/Common/Stats/Stats.cc	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -32,5 +32,5 @@
 	namespace Time {
 		bool enabled = false;
-		void print() {}
+		void print();
 	}
 
Index: src/Common/Stats/Time.cc
===================================================================
--- src/Common/Stats/Time.cc	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
+++ src/Common/Stats/Time.cc	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -0,0 +1,118 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2019 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Time.cc --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Mar 04 15:16:07 2019
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+#include "Time.h"
+
+#include <cassert>
+#include <chrono>
+#include <cstdint>
+#include <cstring>
+#include <iostream>
+#include <iomanip>
+#include <stack>
+
+namespace Stats {
+	namespace Time {
+#		if !defined(NO_TIME_STATISTICS)
+			extern bool enabled;
+
+			Base::TreeTop top;
+
+			class TimerNode : public Base::Tree<top> {
+			public:
+				TimerNode(const char * const name )
+					: Base::Tree<top>(name)
+				{}
+
+				TimerNode(const char * const name, Base::Tree<top> * parent)
+					: Base::Tree<top>(name, parent)
+
+				{}
+
+				virtual void print(std::ostream & os) override {
+					assert(finished);
+					std::chrono::duration<double> diff = end - begin;
+					os << diff.count();
+				}
+
+				void start() {
+					begin = std::chrono::high_resolution_clock::now();
+				}
+
+				void finish() {
+					end = std::chrono::high_resolution_clock::now();
+					finished = true;
+				}
+
+			protected:
+				virtual ~TimerNode() = default;
+
+			private:
+				bool finished = false;
+
+				typedef  std::chrono::time_point<std::chrono::high_resolution_clock> point_t;
+				point_t begin;
+				point_t end;
+			};
+
+			std::stack<TimerNode *> nodes;
+
+			void StartBlock(const char * const name) {
+				if(!enabled) return;
+				auto node = nodes.empty()
+					? new TimerNode(name)
+					: new TimerNode(name, nodes.top());
+
+				nodes.push(node);
+				node->start();
+			}
+
+			void StopBlock() {
+				if(!enabled) return;
+				nodes.top()->finish();
+				nodes.pop();
+			}
+
+			void print() {
+				if(!top.head) return;
+				size_t nc = 0;
+				Base::ForAll(top, 0, [&](Base::TreeImpl * node, size_t level) {
+					nc = std::max(nc, (4 * level) + std::strlen(node->name));
+				});
+
+				const char * const title = "Timing Results";
+				size_t nct = nc + 14;
+				std::cerr << std::string(nct, '=') << std::endl;
+				std::cerr << std::string((nct - std::strlen(title)) / 2, ' ');
+				std::cerr << title << std::endl;
+				std::cerr << std::string(nct, '-') << std::endl;
+
+
+				Base::ForAll(top, 0, [&](Base::TreeImpl * node, size_t level) {
+					std::cerr << std::string(level * 4, ' ');
+					std::cerr << node->name;
+					std::cerr << std::string(nc - ((level * 4) + std::strlen(node->name)), ' ');
+					std::cerr << " | ";
+					std::cerr << std::setw(9);
+					node->print(std::cerr);
+					std::cerr << " |";
+					std::cerr << '\n';
+				}, true);
+
+				std::cerr << std::string(nct, '-') << std::endl;
+			}
+#		endif
+	}
+}
Index: src/Common/Stats/Time.h
===================================================================
--- src/Common/Stats/Time.h	(revision 1bb9a9a31ea68de9c74a5cd408849eadfdf24745)
+++ src/Common/Stats/Time.h	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -18,21 +18,40 @@
 #include "Common/Stats/Base.h"
 
+#if defined( NO_STATISTICS )
+	#define NO_TIME_STATISTICS
+#endif
+
 namespace Stats {
 	namespace Time {
-		void StartBlock(const char * const name);
-		void StopBlock();
+#		if defined(NO_TIME_STATISTICS)
+			inline void StartBlock(const char * const) {}
+			inline void StopBlock() {}
 
-		void print();
+			inline void print() {}
 
-		struct BlockGuard {
-			BlockGuard(const char * const name ) { StartBlock(name); }
-			~BlockGuard() { StopBlock(); }
-		};
+			struct BlockGuard {
+				BlockGuard(const char * const) {}
+				~BlockGuard() {}
+			};
 
-		template<typename func_t>
-		void TimeBLock(const char * name, func_t func) {
-			BlockGuard guard(name);
-			func();
-		}
+			template<typename func_t>
+			inline void TimeBLock(const char *, func_t) {}
+#		else
+			void StartBlock(const char * const name);
+			void StopBlock();
+
+			void print();
+
+			struct BlockGuard {
+				BlockGuard(const char * const name ) { StartBlock(name); }
+				~BlockGuard() { StopBlock(); }
+			};
+
+			template<typename func_t>
+			inline void TimeBLock(const char * name, func_t func) {
+				BlockGuard guard(name);
+				func();
+			}
+#		endif
 	}
 }
Index: src/Common/module.mk
===================================================================
--- src/Common/module.mk	(revision 1bb9a9a31ea68de9c74a5cd408849eadfdf24745)
+++ src/Common/module.mk	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -23,4 +23,5 @@
       Common/Stats/Heap.cc \
       Common/Stats/Stats.cc \
+      Common/Stats/Time.cc \
       Common/UniqueName.cc
 
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision 1bb9a9a31ea68de9c74a5cd408849eadfdf24745)
+++ src/Makefile.in	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -168,5 +168,6 @@
 	Common/PassVisitor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \
 	Common/Stats/Counter.$(OBJEXT) Common/Stats/Heap.$(OBJEXT) \
-	Common/Stats/Stats.$(OBJEXT) Common/UniqueName.$(OBJEXT)
+	Common/Stats/Stats.$(OBJEXT) Common/Stats/Time.$(OBJEXT) \
+	Common/UniqueName.$(OBJEXT)
 am__objects_3 = ControlStruct/ForExprMutator.$(OBJEXT) \
 	ControlStruct/LabelFixer.$(OBJEXT) \
@@ -567,4 +568,5 @@
       Common/Stats/Heap.cc \
       Common/Stats/Stats.cc \
+      Common/Stats/Time.cc \
       Common/UniqueName.cc
 
@@ -741,4 +743,6 @@
 	Common/Stats/$(DEPDIR)/$(am__dirstamp)
 Common/Stats/Stats.$(OBJEXT): Common/Stats/$(am__dirstamp) \
+	Common/Stats/$(DEPDIR)/$(am__dirstamp)
+Common/Stats/Time.$(OBJEXT): Common/Stats/$(am__dirstamp) \
 	Common/Stats/$(DEPDIR)/$(am__dirstamp)
 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \
@@ -1128,4 +1132,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Heap.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Stats.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Time.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 1bb9a9a31ea68de9c74a5cd408849eadfdf24745)
+++ src/main.cc	(revision 4f979377af2a344828be095c82d2fd6fbd8ac976)
@@ -79,5 +79,7 @@
 	if ( errorp ) { cerr << name << endl; } \
 	NewPass(name);                          \
-	pass;
+	Stats::Time::StartBlock(name);          \
+	pass;                                   \
+	Stats::Time::StopBlock();
 
 LinkageSpec::Spec linkage = LinkageSpec::Cforall;
