473,788 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple question: How to find Elapsed time (in seconds)

I need to display elapsed time for a process in VB.NET in secods.
What's the routine to do this?
Thanks

Bill
Mar 6 '06 #1
3 10287
How about something simple like:

Dim StartTime As DateTime = Now

'Any processing here ...

ElapsedTime = Now.Subtract(St artTime).TotalS econds
Dim ElapsedTime As Double =
Now.Subtract(St artTime).TotalS econds
MsgBox("Elapsed seconds: " & ElapsedTime,
MsgBoxStyle.Inf ormation)

-tom

Bill Nguyen ha scritto:
I need to display elapsed time for a process in VB.NET in secods.
What's the routine to do this?
Thanks

Bill


Mar 6 '06 #2

Works great!
Thanks Tomaso!

Bill

<to************ **@uniroma1.it> wrote in message
news:11******** *************@j 33g2000cwa.goog legroups.com...
How about something simple like:

Dim StartTime As DateTime = Now

'Any processing here ...

ElapsedTime = Now.Subtract(St artTime).TotalS econds
Dim ElapsedTime As Double =
Now.Subtract(St artTime).TotalS econds
MsgBox("Elapsed seconds: " & ElapsedTime,
MsgBoxStyle.Inf ormation)

-tom

Bill Nguyen ha scritto:
I need to display elapsed time for a process in VB.NET in secods.
What's the routine to do this?
Thanks

Bill

Mar 6 '06 #3
Bill,

As addition you can as well use the environment.tic kcount
or
The new stopwatch class 2.0
http://msdn2.microsoft.com/en-us/lib...stopwatch.aspx

I hope this helps,

Cor
"Bill Nguyen" <bi************ *****@jaco.com> schreef in bericht
news:OY******** ******@TK2MSFTN GP10.phx.gbl...
I need to display elapsed time for a process in VB.NET in secods.
What's the routine to do this?
Thanks

Bill

Mar 7 '06 #4

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

Similar topics

1
12346
by: NotGiven | last post by:
Below is a good elapsed time function I found. However, I'd like to return total seconds instead of broken down into days, hours, minutes & seconds. In other words, I want "125" instead of "2 minutes 5 seconds". Any ideas? Thanks very much! function calcElapsedTime($time) { // calculate elapsed time (in seconds!) $diff = time()-$time;
3
29036
by: fred14214 | last post by:
I need to be able to enter an elapsed time into a text field. This time then needs to be converted into seconds and stored in a field in some table. The user will enter a time (format is h:minutes:seconds) as such: 0:15:34 (0 hours, 15 minutes, 34 seconds -> 934 seconds total) or as another example:
20
12606
by: Jean Johnson | last post by:
Hello - I have a start and end time that is written using the following: time.strftime("%b %d %Y %H:%M:%S") How do I calculate the elapsed time? JJ
5
14466
by: techspirit | last post by:
Hi, I am seeking help for calculating the elapsed time on an activity. When the user clicks "pause" button on a form, the timer should also pause. When the user clicks "continue", the timer should continue from where the user paused. For example, if the user paused after 10 seconds of progress in the activity, it should start from the 11th second when the user clicks "continue". Am using .Net version 1.1, so if stopwatch performs a...
0
1819
by: Anurag | last post by:
Hi, ENV: DB2 ESE 8.2.3 DPF (11 nodes) on AIX 5.x ==== SCENARIO / SETUP ======== ====== (1) I needed to find out CPU Time (User / System) of SQL queries for benchmark testing. (2) I setup an EVENT MONITOR WHERE AUTH_ID = 'ANURAG' (write to table).
1
5254
by: Bill | last post by:
I have a large number of records that have an elapsed time in seconds for each one that I was to have a total time spent. I can sum them up with query easily enough but I need to be able to display this in a easier to read format. I was able to do that for individual records by multiplying the elapsed time by (1/24/60/60) and using hh:nn:ss for the format but can't for the total because it is greater than 24 hours. I need to be able to do...
12
16378
by: Spitfire | last post by:
I've a requirement to find the elapsed time between two function calls. I need to find the time elapsed accurate to 1 millisecond. The problem I'm facing right now is that, I'm using the 'time()' function call for the purpose and regardless of how many time I invoke the function within my program, I get the same output!!! For better clarity consider the code snippet below. ... start_time = time(NULL);
0
1511
by: Gabriel Genellina | last post by:
En Fri, 02 May 2008 16:13:41 -0300, Simon Pickles <sipickles@googlemail.comescribió: Two options: a) You can construct a datetime object with that info, using datetime.datetime.fromtimestamp() (note that the MySQLdb module already returns datetime objects for timestamp columns in MySQL). If you substract two datetime objects, you get a timedelta object, which stores info as whole days, seconds (fraction of day) and microseconds...
9
3313
by: Ross | last post by:
I'm a newbie at this, and have searched a lot but can't find something that seems appropriate for measuring a recurring elapsed time. Creating an object with: var mydate = new Date(); seems clear, as is creating a second: nowTime = new Date(); and getting a difference between the two. My quesiton is what if you have many, maybe thousands of intervals you wish to measure? Should I do: nowTime = new Date(); with every pass of a...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.