This repository was archived by the owner on Mar 27, 2024. It is now read-only.
File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -305,14 +305,19 @@ public void testGenerateTimeBasedUUID()
305
305
// before we generate all the uuids, lets get the start time
306
306
long start_time = Environment . TickCount ;
307
307
308
+ // high-resolution timer
309
+ Stopwatch timer = Stopwatch . StartNew ( ) ;
310
+
308
311
// now create the array of uuids
309
312
for ( int i = 0 ; i < uuid_array . Length ; i ++ )
310
313
{
311
314
uuid_array [ i ] = uuid_gen . GenerateTimeBasedUUID ( ) ;
312
315
}
313
316
317
+ timer . Stop ( ) ;
318
+
314
319
// now capture the end time
315
- long end_time = Environment . TickCount ;
320
+ long end_time = start_time + timer . ElapsedTicks ;
316
321
317
322
// check that none of the UUIDs are null
318
323
checkUUIDArrayForNonNullUUIDs ( uuid_array ) ;
@@ -372,8 +377,8 @@ public void testGenerateTimeBasedUUIDWithEthernetAddress()
372
377
// before we generate all the uuids, lets get the start time
373
378
long start_time = Environment . TickCount ;
374
379
375
- // high-resolution timer
376
- var timer = Stopwatch . StartNew ( ) ;
380
+ // high-resolution timer
381
+ Stopwatch timer = Stopwatch . StartNew ( ) ;
377
382
378
383
// now create the array of uuids
379
384
for ( int i = 0 ; i < uuid_array . Length ; i ++ )
Original file line number Diff line number Diff line change 20
20
using System . Collections . Generic ;
21
21
using System . Net . NetworkInformation ;
22
22
using System . Security . Cryptography ;
23
+ using System . Diagnostics ;
23
24
24
25
namespace Jug . Test
25
26
{
@@ -145,15 +146,19 @@ public void testGetTimestamp()
145
146
// before generating all the uuid timer arrays, get the start time
146
147
long start_time = Environment . TickCount ;
147
148
149
+ Stopwatch timer = Stopwatch . StartNew ( ) ;
150
+
148
151
// now create the array of uuid timer output arrays
149
152
for ( int i = 0 ; i < array_of_uuid_timer_byte_arrays . Length ; i ++ )
150
153
{
151
154
array_of_uuid_timer_byte_arrays [ i ] = new byte [ UUID_TIMER_ARRAY_LENGTH ] ;
152
155
uuid_timer . GetTimestamp ( array_of_uuid_timer_byte_arrays [ i ] ) ;
153
156
}
154
157
158
+ timer . Stop ( ) ;
159
+
155
160
// now capture the end time
156
- long end_time = Environment . TickCount ;
161
+ long end_time = start_time + timer . ElapsedTicks ;
157
162
158
163
// convert the array into array of longs holding the numerical values
159
164
long [ ] uuid_timer_array_of_longs =
You can’t perform that action at this time.
0 commit comments