Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 26th, 2005, 08:32 AM
egidy egidy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 166 egidy User rank is Private First Class (20 - 50 Reputation Level)egidy User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 31 sec
Reputation Power: 5
TTimer vs sleep fro win32 service applicatian?

what are possible pro's and con's for each of this solution?

Reply With Quote
  #2  
Old June 26th, 2005, 08:58 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Personally I recommend TTimer ... sleep can cause the service to hang.
__________________
If i've been helpful, please add to my reputation.
My unfinished site: http://www.dever.ro

Reply With Quote
  #3  
Old June 27th, 2005, 02:04 AM
calvinscy calvinscy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Location: Kuala Lumpur, Malaysia
Posts: 77 calvinscy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 50 m 9 sec
Reputation Power: 4
Quote:
Originally Posted by SilverDB
Personally I recommend TTimer ... sleep can cause the service to hang.


I agree too.. Use TTimer.

Reply With Quote
  #4  
Old June 27th, 2005, 02:25 AM
egidy egidy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 166 egidy User rank is Private First Class (20 - 50 Reputation Level)egidy User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 31 sec
Reputation Power: 5
Maybe, that TTIme is better, however I am a bit confused in which thread its omExecute handler run?

Reply With Quote
  #5  
Old June 27th, 2005, 06:16 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Quote:
Originally Posted by egidy
Maybe, that TTIme is better, however I am a bit confused in which thread its omExecute handler run?


ServiceThread

Reply With Quote
  #6  
Old June 27th, 2005, 07:39 PM
xo310 xo310 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 xo310 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 10 sec
Reputation Power: 0
procedure Delay(Milliseconds: Int64);
var
Tick: DWord;
Event: THandle;
s: Int64;
begin
Event := CreateEvent(nil, False, False, nil);
try
Tick := GetTickCount + DWord(Milliseconds);
while (Milliseconds > 0) and
(MsgWaitForMultipleObjects(1, Event, False, Milliseconds, QS_ALLINPUT) <>
WAIT_TIMEOUT) do
begin
Application.ProcessMessages;
s := GetTickCount;
Milliseconds := Tick - s;
end;
finally
CloseHandle(Event);
end;
end;

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > TTimer vs sleep fro win32 service applicatian?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT