TimeInMillis different in java than in C

I have a a problem getting a match between the epoche seconds derived within a C program and the return value of System.currentTimeMillis(); Here is an example:
* Simple C program for running on Windows Machines
* My testing is occuring on Win2K
#include <time.h>
int main()
   printf("hello %ld\n", time(NULL));
   return 0;
// end TestTime.c
* Simple Java Program grabbing epoche
* Tested on same system
public class TimeTest
   public static void main(String[] args)
      System.out.println(System.currentTimeMillis());
// end TestTime.javaOutput of these programs occured at Jun 12, 2002 at about 11:04am
C prints: 1023894070
Java prints: 1023894043362
Any ideas? Should I be using a different Java call? I need to compare the two which is not possible with how different the outputs are.

Wow, quickest response I have ever recieved!
I know they are not exact becuase I am at a DOS prompt doing this:
C:\test> TestTime
c time
C:\test> java TestTime
java time
I don't expect them to be identical becuase I can only type so fast.
These appear to have been run about 27 seconds apart.I have a DOS window filled with different executions and print outs. I could of copied the wrong time into the last post.
Here is a print out executing them as fast as I can type "java TestTime" after running the c version.
C: ����1023895806
Java: 1023895808029
My question is should I just append three 0's onto the C version. I need to run lines like this:
if(javaTime >= curSysTimeFromC) which would always be true due to the more accurate reading given by java. This little C program will act like a UNIX CRON. My java program edits the files read by the C version. The files are simple key/value pairs of which the C program looks for, "time=epoche_seconds", pair.

Similar Messages

  • Different between Java TRial Edition

    Can someone please explain the difference between different SAP Java editoin available at:
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/cfc19866-0401-0010-35b2-dc8158247fb6
    Regards
    Suhail

    Javascript is a scripting language usually embedded in HTML. Java is an partially compiled programming language much more powerful than Javascript.

  • HT201622 How do I install apps on a new iPhone 6 that uses a different Apple ID than the one used to purchase the apps?

    How do I install apps on a new iPhone 6 that uses a different Apple ID than the one used to purchase the apps?

    Sign in to the iPhone or connect the phone to the computer and sign into the store using the original ID and download the apps to the phone?

  • My iPad has a different Apple ID than the Apple ID on my computer. The iPad Apple ID has an email address that I no longer use. If I try to add the email address that I now use (and which is my Apple ID on the computer), it won't allow me to add it.

    My iPad has a different Apple ID than the Apple ID on my computer. The iPad Apple ID has an email address that I no longer use. If (while on the iPad) I go to My Apple ID and try to change or add the email address that I now use (and which already is my Apple ID on the computer), it won't allow me to add it. It says : "Email address is already verified for another Apple ID"  I haven't really been aware of this as a problem until I tried (for the first time) to sync my iPad to the computer and became aware that certain things wouldn't transfer. What is the solution to this?

    What are you having problems with ?
    This post was about having updated the primary email address on an iTunes account via a computer - if you do that you might need to log out of the account on an iPad by tapping on the id in Settings > iTunes & App Store and then log back in with the updated version of the account for that email address change to be recognised on your iPad. If you don't log out and back in then an iPad (or iPhone or iPod Touch) might continue to show the old version of the iTunes account id.

  • I have apple TV and i am trying to connect it to the TV, it tells me to turn on the homesharing,  but under the home sharing shows a different email address than the actual itunes account.  how do i fixthanks it?

    i just got an Apple TV. i am trying to connect my itunes to the tv, it tells me to turn on the homesharing on my computer but when i try it show up a different email address than my itunes account, how do i fix so i can do homesharing?

    It is quite possible to have a different iCLoud AppleID from the iTunes one - have you set up maybe Phot Stream using an non-iTunes AppleID?

  • Another "This itunes account is set up to use family sharing with a different icloud account than Apple ID "

    I saw another thread on the matter but thought I would post because the circumstances are different. Here is how it happened.
    I have had an Apple Store account for years and until recently our family has only had our one Mac and my iPhone 4. Thus any purchases we have made on the Apple App Store were made only with this account.
    We recently purchased two iPhone 5S's--one for my wife and one for my daughter. Neither had Apple IDs so first we set up my wife's iPhone and created an Apple ID for her. Next we used the Family Sharing feature to set up an account for our "under age 13" daughter.
    Because I am still waiting for my iPhone 6 Plus to arrive, and because the iPhone 4 cannot upgrade to iOS 8, and because my Apple ID is the only account with any apps that have been purchased in prior years, I set up my wife as the Family Organizer but when I set up her account, I chose the option to "share purchases from a different account" and entered the information for my Apple ID.
    My daughter is able to view my prior purchases on her iPhone, but when my wife tries to view my prior purchases, she receives the message "This iTunes account is set up to use Family Sharing with a different iCloud account than <her Apple ID>."
    I hope Apple is reading this. I would be more than willing to help them on this one as this feature is one of the main reasons I put our family on iPhones.

    I had this problem. I finally figured it out yesterday. Try this:
    On the device that is having trouble seeing purchases, go to Settings>iCloud>Family Sharing> Then tap on the user of the device you are on. Under "Family Purchases" make sure it has the AppleID of the person for that device. Mine originally had my husbands AppleID in there (he is the Organizer), but I changed it to mine. That doesn't make it so that the purchases are under me. The purchases remained under my husband, but my ID had to be in this spot for it to work.
    After that, I closed settings, then I went to Settings>iTunes and App Store> click on the AppleID and Sign Out, even if it has the right AppleID in there. Then Sign In again using the AppleID of the person on that device. Again-- even if it has the right ID in there to start, still sign out and back in.
    See if they show up. If they don't show up still, try doing a restart (hold down power button and home button until it restarts).
    They should show up by then, but if they don't, at that point, try to go into iCloud and Sign Out and back in.
    I think the key is having the right ID in "Family Purchases". I hope this works for you.

  • I need help with color pallette in iPhoto 11. I have created a book and would like to use a different color background than those given in "background." I have found the color palettes but can't seem to incorporate them into my backgrounds palette.

    I need help with color pallette in iPhoto 11. I have created a book and would like to use a different color background than those given in "background." I have found the color palettes but can't seem to incorporate them into my backgrounds palette.

    That is not a feature of iPhoto - suggest to Apple - iPhoto Menu ==> provide iPhoto feedback.
    Additionally I have no idea what you are saying here
    I have found the color palettes but can't seem to incorporate them into my backgrounds palette.
    And it always helps for you to dientify the version of iPhoto that you are using
    LN

  • My Apple TV was set up with a different Apple ID than I have for my ITunes Account.  In other words I have multiple Apple ID's.  How can get these accounts to sync up?

    My Apple TV was set up with a different Apple ID than I have for my ITunes Account.  In other words I have multiple Apple ID's.  How can get these accounts to sync up?

    If you wish to use home sharing then you need to setup the Apple TV under your ID.

  • My itunes account keeps giving me this Error message. "You are signed in with a different Apple ID than previously used with podcasts. I only have one Apple ID. What do I do?

    My itunes account keeps giving me this Error message. "You are signed in with a different Apple ID than previously used with podcasts. Do you want to sync these podcasts subscriptions and stations with "gajppl""  gajppl is my only Apple ID. What do I do?

    Please sign out of the iTunes Store by selecting
    Store ▹ Sign Out
    from the iTunes menu bar. Then sign back in.

  • HT1727 I have iTunes music on my iPhone and I want to transfer the music to my iPod.  But my phone uses a different iTunes account than my old iPod.  How can I move music on my phone to my iPod?  Thank you.

    I have an old iPod that has a different Apple ID than my iPhone.  How can I put all the music on my iPod and get it off my phone?  I'm not sure how to mix the music from two different apple id's.

    Hi KathySA,
    Thanks for visiting Apple Support Communities.
    You can sync songs to your iPod from your iTunes library on a computer. You may need to authorize the computer with both of your Apple IDs:
    iTunes: Syncing media content to iPod
    http://support.apple.com/kb/HT1351
    iTunes Store: Authorize or deauthorize your Mac or PC
    http://support.apple.com/kb/ht1420
    If some music from the iTunes Store is only on your iPhone, you can transfer purchases to the computer:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/ht1848
    Cheers,
    Jeremy

  • Is there a way to change the color of the Bezier Curves and points to a different color other than black  I find it perplexing while setting points and curves working on a photo that needs to be separated from it's background for placement on transparent

    Is there a way to change the color of the Bezier Curves and points to a different color other than black  I find it perplexing while setting points and curves working on a photo that needs to be separated from it's background for placement on transparent backgrounds. Any thoughts?

    Yes. Well, sort of: instead of a "path", set the pen tool to "shape" in the tool properties. Then set the fill colour to transparent, and the stroke colour to the colour you want. You can also set the stroke width.
    Not perfect, but at least you can see the path more clearly - the anchor points and handles still remain the default colour. Open the path panel, and right-mouse click the path shape to create a selection based on that shape. The Paths panel menu also allows you to create work paths based on that shape.
    Unfortunately when you try to move the handles the black thin outline appears again until you release the mouse button.
    This is one of several things that works better in Photoline: in Photoline, once the path is set to a specific colour, editing the path uses the actual colour and stroke width. which is extremely handy for creating path based selection with awkward background colours and/or a high resolution screen. In Photoline the handles and bezier points are also much, much larger, which makes it rather simpler to work with as well - especially on a higher resolution screen. And when selected the handles and points are a clear red with a black outline - again easier to spot and identify. I just works better, in my opinion.

  • Why does ical on icloud have a different lay out than on my mac

    Why does iCal on my MacBook Pro have a different lay out than on iCloud? I like the iCloud layout better, the only missing niceties is the year calendar. How do I get both iCals to look the same? The ideal iCal? The one from iCloud WITH the year calendar.

    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    Please update Firefox to the latest version via "Help > Check for Updates or Help > About Firefox"<br />
    The Firefox version that you use is no longer maintained with security and stability updates.<br />
    Using unsupported Firefox versions is at your own risk and makes you vulnerable to attacks.<br />
    *Firefox 7.0.x: http://www.mozilla.com/en-US/firefox/all.html

  • I need to purchase an app using a different credit card than the one on my account how do I do it

    I need to purchase an app using a different credit card than the one on my account how do I do it?

    Hello Dylanshopes,
    It sounds like you would like to use different payment info than what is currently associated with your account. This article will help you change that information named:
    iTunes Store: Changing your payment information
    http://support.apple.com/kb/ht1918
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • Why is optimizer different in sql than in pl/sql?

    Hello, I am running Oracle database 9i, it is running on an On-Demand hosted server, its purpose is to serve our Oracle Payroll application.
    I have a certain query, and first tried it as a stand-alone query. It displayed the results almost immediatly.
    Then I inserted the exact same query in a pl/sql block. It took more than one hour and canceled it. By looking at the session browser in TOAD, I saw that it was stuck on that query.
    I also saw that the explain-plan for the query changed drastically from running as stand-alone sql to running inside pl/sql.
    Why is this happening? How can I avoid this?
    Please note that I do not intend to use optimizer hint since the indexes are built by oracle On-Demand and not me, so I don't know which indexes exist.
    Here is the explain plan when running from stand-alone SQL:
    Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE          1           65                     
    bq. SORT AGGREGATE          1      72
    bq. bq. TABLE ACCESS BY INDEX ROWID     HR.PAY_ELEMENT_ENTRY_VALUES_F     1      13      4
    bq. bq. bq. NESTED LOOPS          1      72      65
    bq. bq. bq. bq. MERGE JOIN CARTESIAN          1      59      61
    bq. bq. bq. bq. bq. TABLE ACCESS BY INDEX ROWID     HR.PAY_ELEMENT_ENTRY_VALUES_F     1      13      4
    bq. bq. bq. bq. bq. bq. NESTED LOOPS          1      36      33
    bq. bq. bq. bq. bq. bq. bq. TABLE ACCESS BY INDEX ROWID     HR.PAY_ELEMENT_ENTRIES_F     1      23      29
    bq. bq. bq. bq. bq. bq. bq. bq. INDEX RANGE SCAN     HR.PAY_ELEMENT_ENTRIES_F_N50     44           3
    bq. bq. bq. bq. bq. bq. bq. INDEX RANGE SCAN     HR.PAY_ELEMENT_ENTRY_VALUES_F_N50     9           3
    bq. bq. bq. bq. bq. BUFFER SORT          1      23      57
    bq. bq. bq. bq. bq. bq. TABLE ACCESS BY INDEX ROWID     HR.PAY_ELEMENT_ENTRIES_F     1      23      28
    bq. bq. bq. bq. bq. bq. bq. INDEX RANGE SCAN     HR.PAY_ELEMENT_ENTRIES_F_N50     44           2
    bq. bq. bq. bq. INDEX RANGE SCAN     HR.PAY_ELEMENT_ENTRY_VALUES_F_N50     9           3
    And here is the plan when running inside pl/sql:
    Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE 1 293463
    bq. SORT AGGREGATE 1 48
    bq. bq. MERGE JOIN CARTESIAN 1 M 56 M 293463
    bq. bq. bq. MERGE JOIN CARTESIAN 78 3 K 3771
    bq. bq. bq. bq. MERGE JOIN CARTESIAN 1 34 57
    bq. bq. bq. bq. bq. TABLE ACCESS BY INDEX ROWID HR.PAY_ELEMENT_ENTRIES_F 1 17 29
    bq. bq. bq. bq. bq. bq. INDEX RANGE SCAN HR.PAY_ELEMENT_ENTRIES_F_N50 44 3
    bq. bq. bq. bq. BUFFER SORT 1 17 28
    bq. bq. bq. bq. bq. TABLE ACCESS BY INDEX ROWID HR.PAY_ELEMENT_ENTRIES_F 1 17 28
    bq. bq. bq. bq. bq. bq. INDEX RANGE SCAN HR.PAY_ELEMENT_ENTRIES_F_N50 44 2
    bq. bq. bq. BUFFER SORT 15 K 107 K 3743
    bq. bq. bq. bq. TABLE ACCESS BY INDEX ROWID HR.PAY_ELEMENT_ENTRY_VALUES_F 15 K 107 K 3714
    bq. bq. bq. bq. bq. INDEX RANGE SCAN HR.PAY_ELEMENT_ENTRY_VALUES_F_N1 15 K 39
    bq. bq. BUFFER SORT 15 K 107 K 289749
    bq. bq. bq. TABLE ACCESS BY INDEX ROWID HR.PAY_ELEMENT_ENTRY_VALUES_F 15 K 107 K 3714
    bq. bq. bq. bq. INDEX RANGE SCAN HR.PAY_ELEMENT_ENTRY_VALUES_F_N1 15 K 39
    As you can see, the cost goes way up when running inside a pl/sql block.
    Thank you very much for your help.
    Eduardo Sch&ntilde;adower
    Edited by: shinaco on Dec 12, 2008 4:10 PM
    Added indentation. Sorry for that, I didn't realize copy-paste didn't work well here.

    I meant to add,
    Why is optimizer different in sql than in pl/sql? It is not different, it is the same optimizer.
    If you replace bind variables with literals then you have a totally different query, with much more information available to the optimizer. If you are seeing the same statement with the same literal values get a different plan within PL/SQL than in SQL*Plus or TOAD etc then there must be something else different. Unfortunately there is a lot less diagnostic info available in 9i (and I don't have 9i around to test on). Perhaps you can get a 10053 trace from each session and see if you can see what is different.
    btw I still can't read the execution plan. There is more information in the DBMS_XPLAN output, and it needs to be formatted using ** tags or equivalent HTML.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Hi - for any photo, info in mountain lion shows a different file size than Photoshop does. I've tested with CS3 and CS6 and get the same problem. Doesn't happen with CS3 and OSX10.4 or any previous versions of Photoshop and OSX. Anyone know why?

    Hi - for any photo, info in mountain lion shows a different file size than Photoshop does. I've tested with both CS3 and CS6 on 10.8.2 and get the same problem. This doesn't happen with CS3 and OSX10.4 or any previous versions of Photoshop and OSX. Anyone know why?

    this one is actually a really rare symptom of a flaky connection to the ipod on a Windows PC. there's more going on in terms of hardware on nanos and 5th gens than in the earlier models ... so if the connection is flaky to precisely the right/wrong degree, itunes will see the ipod, but misidentify it as an earlier version of ipod.
    tracking down the cause of the flakiness can be tricky ... as you already know ...
    just checking. have you tried connecting with a different (known-good) USB cable? does that seem to have any impact on the rate of occurence of the problem?

Maybe you are looking for

  • T430 Performanc​e

    I bought my T430 (core i5, 4gb, win7 64-bit) a little over 2 years ago. The machine slowed down quiet a bit. So I wiped the hard-drive clean, re-installed the OS and only installed a few additional apps. I feel the performance has slightly improved,

  • ITV no longer connects Home Share, and Netflix crashes mid movie. This worked on Christmas - day two flop

    I know... I searched the forum and this is a very hot topic. But I am not a techie and really don't want to reconfigure my iMac System energy preferences to tell the computer to 'never sleep' and to deselect the 'Put the hard disk(s) to sleep wheneve

  • Problem with Logic Pro and Soft eLicenser on Mountain Lion?

    Hi! I have a bunch of Arturia synths, which requires the Soft eLicenser to work. This has always worked great with Lion, never any problems with eLicenser (never had to open it etc.) Now - I upgraded to Mountain Lion, and tested my synths to make sur

  • Netcfg2 with ppp (3G, UMTS) ?

    Hey guys, I'm currently using wvdial and a profile for that to bring up my 3G connection. /etc/wvdial.conf [Dialer Defaults] Modem = /dev/ttyUSB0 Baud = 460800 [Dialer three] Phone = *99***1# Username = three.ie Password = three.ie Stupid Mode = 1 Di

  • DJ program for mac besides iTunes

    I have a duel USB ibook here with a 600 MHz processor and 256 mb of ram. I'm looking for some kind of DJ program I can use for this thing. I have 10.4.11 on this thing..I need a DJ program similar to something like Ultra Mixer or djay. It can be a pr