I am using this code to generate a 8 digit unique number.
byte[] buffer = Guid.NewGuid().ToByteArray(); return BitConverter.ToUInt32(buffer, 8).ToString(); <
System.Threading.Thread.Sleep(1); long code = (long)DateTime.UtcNow.Subtract(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
OR
System.Threading.Thread.Sleep(1000); long code = (long)DateTime.UtcNow.Subtract(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;