|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datetime arithmetic in VB.Net?display the remaining time, in days:hours:minutes. I'm looking to do something like: Dim tsTimeRemaining as System.Timespan Dim tsElapsedTime as System.Timespan dtTimeRemaining = intRemainingRecords * (tsElapsedTime / intRecordsAlreadyProcessed) Could someone help me out with the appropriate arithmetic operators/casts/etc. Thanks. Joe -- Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ------->>>>>>http://www.NewsDemon.com<<<<<<------ Unlimited Access, Anonymous Accounts, Uncensored Broadband Access "Joe Befumo" <j**@befumo.com> schrieb Function GetTotalTime( _> I have a program that processes a large number of records & would > like to display the remaining time, in days:hours:minutes. > > I'm looking to do something like: > > Dim tsTimeRemaining as System.Timespan > Dim tsElapsedTime as System.Timespan > dtTimeRemaining = intRemainingRecords * (tsElapsedTime / > intRecordsAlreadyProcessed) > > Could someone help me out with the appropriate arithmetic > operators/casts/etc. ByVal Counter As Integer, _ ByVal Total As Integer, _ ByVal Elapsed As TimeSpan, _ ByRef Remaining As TimeSpan) _ As TimeSpan GetTotalTime = TimeSpan.FromSeconds(Elapsed.TotalSeconds / Counter * Total) Remaining = GetTotalTime.Subtract(Elapsed) End Function Returns the total time as the function value and the remaining time as a parameter. Armin Great, thanks so much!
Joe Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:OqU2nlDSGHA.4976@TK2MSFTNGP11.phx.gbl... > "Joe Befumo" <j**@befumo.com> schrieb >> I have a program that processes a large number of records & would >> like to display the remaining time, in days:hours:minutes. >> >> I'm looking to do something like: >> >> Dim tsTimeRemaining as System.Timespan >> Dim tsElapsedTime as System.Timespan >> dtTimeRemaining = intRemainingRecords * (tsElapsedTime / >> intRecordsAlreadyProcessed) >> >> Could someone help me out with the appropriate arithmetic >> operators/casts/etc. > > Function GetTotalTime( _ > ByVal Counter As Integer, _ > ByVal Total As Integer, _ > ByVal Elapsed As TimeSpan, _ > ByRef Remaining As TimeSpan) _ > As TimeSpan > > GetTotalTime = TimeSpan.FromSeconds(Elapsed.TotalSeconds / Counter * > Total) > Remaining = GetTotalTime.Subtract(Elapsed) > > End Function > > Returns the total time as the function value and the remaining time as a > parameter. > > > Armin -- Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ------->>>>>>http://www.NewsDemon.com<<<<<<------ Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Open a Text File in Notepad using VB.Net 2005
I miss loop [Help] Reading data from a DLL structure in C Playing System Sounds/WAV files best way to tell if a date is not assigned? Where is ThisWorkbook.Sheets("xx") ?? Unable to resolve 'ThisWorkbook' :: Interop to Excel Visual Basic .NET Resource Kit bindingsource running balance in datagrid what should i use? |
|||||||||||||||||||||||