Tuesday, June 30, 2009

C# - version of Java currentTimeMillis

Java System.currentTimeMillis() is a very good utility to measure time in Java. However, in C#, it uses Ticks. There is 2 simple way to have a similar version of it

1. Use System.Environment.TickCount, it will return the number of millis elapsed since system started.

2. Use DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond, this will convert current time in Ticks to millisecond.

No comments:

Post a Comment

Oracle - Reclaim disk space

Oracle does not release disk space even if you had delete the data or tablespace. If you have enterprise manager, you should use it to  rec...