Mercurial > projects > dynamin
comparison dynamin/core/environment.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 73060bc3f004 |
children |
comparison
equal
deleted
inserted
replaced
105:97997a544ac0 | 106:acdbb30fee7e |
---|---|
100 | 100 |
101 unittest { | 101 unittest { |
102 auto startTime = Environment.runningTime; | 102 auto startTime = Environment.runningTime; |
103 assert(startTime > 0); | 103 assert(startTime > 0); |
104 auto time = startTime; | 104 auto time = startTime; |
105 const SAMPLE = 50; | 105 enum SAMPLE = 50; |
106 // makes sure that RunningTime does not go backwards | 106 // makes sure that RunningTime does not go backwards |
107 for(int i = 0; i < SAMPLE;) { | 107 for(int i = 0; i < SAMPLE;) { |
108 auto time2 = Environment.runningTime; | 108 auto time2 = Environment.runningTime; |
109 assert(time2 >= time); | 109 assert(time2 >= time); |
110 if(time2 > time) { | 110 if(time2 > time) { |