I am porting a Python script to C#.
Currently I have encountered the code that uses
time.time()
As per Python documentation this function call returns a float of total count of seconds.
Return the time as a floating point number expressed in seconds since
the epoch, in UTC. Note that even though the time is always returned
as a floating point number, not all systems provide time with a better
precision than 1 second. While this function normally returns
non-decreasing values, it can return a lower value than a previous
call if the system clock has been set back between the two calls.
How can I get the same from CLR?
The start of “the Epoch” on Unix refers to January 1, 1970. That’s a fairly arbitrary date, set to be “early enough” that anyone querying the time since that date would get a positive number of seconds.
http://blogs.msdn.com/b/brada/archive/2004/03/20/93332.aspx