C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 6th, 2006, 03:51 AM
jaro jaro is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 35 jaro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 16 m 44 sec
Reputation Power: 4
Send a message via Yahoo to jaro
Need some clarificaton...

Hi,

I have these ff. code:
Code:
/*test/dummy progam*/

#include <time.h>
//var declaration
clock_t start, finish;
double  duration;
double  limit = 5.00; // roughly equal to 5 seconds
int x;

int main(){
    //
    //
    //
    start = clock();
    x=1;

        while(1){
            finish = clock();
            duration = (finish - start) / CLOCKS_PER_SEC;

            if(limit < duration){
                 /* do stuff....*/      
                 printf("round %d",x++); // for example
                start = clock();
                duration =0.00;
            }

        }
return 0;
}


I know that this is not resourece friendly type of code. The code above is a test/dummy program ,the program while running will execute the printf() in every 5 second.
The test/dummy program works fine but when I try to insert this logic to the project that I'm currently working on , it does not work.
The project mentioned here is converted/or run as a Windows service.

I've written the test/dummy program as a Win32 console application. The project that I've mentioned is previously a Win32 console application before it is converted to run as a windows service.

Can anyone tell me why this is happening?

I'm Using MVC6 and my os is Win2K.

BTW: when I tried to convert the test/dummy program run run as a Windows service, the test/dummy program does not execute - I mean does not print ( I've change the printf() to a writeToLog type of function).

any kind of help will be appreciated.

regards,
jaro

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Need some clarificaton...


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