Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3721408
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:32:44+00:00 2026-05-19T05:32:44+00:00

I have a requirement to start my application at certain time. I don’t want

  • 0

I have a requirement to start my application at certain time. I don’t want to be put in the corn job. My executable is an application and like to start on 2011-Jan-20
So I have to run it as
./app –date 2011-Jan-20

Here problem is, how I will calculates the time difference from current and date supplied in command line option.

I don’t want to write won function. Is there any in build function are available for such type of time difference. ( c and Linux)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:32:46+00:00Added an answer on May 19, 2026 at 5:32 am

    You can calculate the difference between the start time and now in milliseconds and then wait for that many milliseconds by passing that number as a timeout argument to select() or epoll().

    To calculate the difference, one way is to first convert your date string to struct tm using strptime() and then pass it to mktime() which is going to give you a number of seconds since unix epoch 1970-01-01 00:00:00. Then get the current time by using gettimeofday() or clock_gettime(), they also report time passed since unix epoch. Convert the start time and the current time to seconds and subtract the values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have requirement as following like showing ABPeoplePickerNavigationController in tabbar based application. I researched
I have a application requirement in Android. In my application I want to add
I have requirement where some times I would like to load children as well
I have requirement like, suppose I have a 'property' table which has 'ListingKey' field
I need to start 1-3 external programs in my Java application that have paths
I have a requirement that when application install on device then it will never
In my existing application org.apache.log4j API's have been used in java code. Requirement :
Normally I create web application projects and use code-behind, but I have a requirement
In my application I have to retrieve data from a database. My requirement is
I have a requirement to start up the browser of an E-Ink Nook and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.