473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

GetTimestamp()

Anyone knows how to convert the ticks into seconds or milliseconds?

beginTick = GetTimestamp();
endTick = GetTimestamp();

totalTick = endTick - beginTick;

How many seconds will be the totalTick ?
Dec 7 '06 #1
1 8311
"Alan T" <al*************@yahoo.com.auwrote in message
news:uJ**************@TK2MSFTNGP04.phx.gbl...
Anyone knows how to convert the ticks into seconds or milliseconds?

beginTick = GetTimestamp();
endTick = GetTimestamp();

totalTick = endTick - beginTick;

How many seconds will be the totalTick ?
That depends on your Stopwatch, as the documentation clearly indicates. You
need to look at the Stopwatch.Frequency property to determine how many ticks
there are per second.

IMHO, if what you want is a time with the resolution of seconds or
milliseconds, then it would make more sense to just use the DateTime.Ticks
property. But if you really want to use the Stopwatch class, you can
convert from ticks to seconds simply by dividing the total ticks by the
frequency. Divide that result by 1000 to find milliseconds.

Pete
Dec 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Koen | last post by:
Hi! I have a vector containing the following: vector<Base*> theVector; theVector.push_back(new Der1()); theVector.push_back(new Der1()); theVector.push_back(new Der2());...
1
by: Akshat | last post by:
Hi. i am facing a problem. How do i save a java.util.Date in a SQLServer column declared as a 'datetime' . and please tell me how to retrieve it too.
8
by: Zvonko | last post by:
Hi! I would like to get the clients date and time (his system time) and store it somewhere so I can use it in my code later. (insert it to database!). Any ideas Zvonko
1
by: Sandy | last post by:
HI All, I have created a MFC exe using VC++ .NET 2003 on Windows XP Prof service pack 2 and it works properly on my machine, but when I run the same exe on a different machine (Windows XP Prof...
4
by: Sandy | last post by:
HI All, I have created a MFC exe using VC++ .NET 2003 on Windows XP Prof service pack 2 and it works properly on my machine, but when I run the same exe on a different machine (Windows XP Prof...
0
by: Sandy | last post by:
HI All, I have created a MFC exe using VC++ .NET 2003 on Windows XP Prof service pack 2 and it works properly on my machine, but when I run the same exe on a different machine (Windows XP Prof...
9
by: renisha | last post by:
I am trying to retreive a string in this format dd-MM-yyyy hh:mm:ss a from Oracle database from the column of type Date which has value 10/09/2007 07:11:16 Date strfinaldate = new...
0
by: kerplunkwhoops | last post by:
Hello I am wanting to use the high accuracy of System.Diagnostics.Stopwatch to get the current time using GetTimeSpan. Underneath, System.Diagnostics.Stopwatch.GetTimeStamp uses the win32 API...
53
by: Aaron Gray | last post by:
I jokingly say this is the late entry :) Okay I have read all the event entry comments from John's Resig's AddEvent comepition blog :- http://ejohn.org/projects/flexible-javascript-events/ ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.