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

Hadoop - How to setup a Hadoop Cluster

Below is a step-by-step guide which I had used to setup a Hadoop Cluster Scenario 3 VMs involved: 1) NameNode, ResourceManager - Host...