How to get exact time since iOS device booted? [duplicate]












1
















This question already has an answer here:




  • Getting iOS system uptime, that doesn't pause when asleep

    6 answers




I've encountered a problem. I need to get the exact TimeInterval since the device was booted. In the CoreMotion framework CMLogItem class have timestamp property, it returns exact time since device was booted. (link) This is necessary in order to measure the exact time for which the event occurred.



I tried the following code:



let timestamp = ProcessInfo.processInfo.systemUptime


but it returns different time than i need.
Any help is appreciated, thanks in advance!










share|improve this question













marked as duplicate by ayaio, Rob Napier ios
Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Apr 7 '17 at 12:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    1
















    This question already has an answer here:




    • Getting iOS system uptime, that doesn't pause when asleep

      6 answers




    I've encountered a problem. I need to get the exact TimeInterval since the device was booted. In the CoreMotion framework CMLogItem class have timestamp property, it returns exact time since device was booted. (link) This is necessary in order to measure the exact time for which the event occurred.



    I tried the following code:



    let timestamp = ProcessInfo.processInfo.systemUptime


    but it returns different time than i need.
    Any help is appreciated, thanks in advance!










    share|improve this question













    marked as duplicate by ayaio, Rob Napier ios
    Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Apr 7 '17 at 12:15


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      1












      1








      1









      This question already has an answer here:




      • Getting iOS system uptime, that doesn't pause when asleep

        6 answers




      I've encountered a problem. I need to get the exact TimeInterval since the device was booted. In the CoreMotion framework CMLogItem class have timestamp property, it returns exact time since device was booted. (link) This is necessary in order to measure the exact time for which the event occurred.



      I tried the following code:



      let timestamp = ProcessInfo.processInfo.systemUptime


      but it returns different time than i need.
      Any help is appreciated, thanks in advance!










      share|improve this question















      This question already has an answer here:




      • Getting iOS system uptime, that doesn't pause when asleep

        6 answers




      I've encountered a problem. I need to get the exact TimeInterval since the device was booted. In the CoreMotion framework CMLogItem class have timestamp property, it returns exact time since device was booted. (link) This is necessary in order to measure the exact time for which the event occurred.



      I tried the following code:



      let timestamp = ProcessInfo.processInfo.systemUptime


      but it returns different time than i need.
      Any help is appreciated, thanks in advance!





      This question already has an answer here:




      • Getting iOS system uptime, that doesn't pause when asleep

        6 answers








      ios swift core-motion






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 7 '17 at 11:03









      Andrey M.Andrey M.

      1,2541229




      1,2541229




      marked as duplicate by ayaio, Rob Napier ios
      Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Apr 7 '17 at 12:15


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by ayaio, Rob Napier ios
      Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Apr 7 '17 at 12:15


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          1 Answer
          1






          active

          oldest

          votes


















          1














          After investigation of the data you provide. It is possible to conclude that CMLog​Item:




          The CMLog​Item class is a base class for Core Motion classes that
          handle specific types of motion events. Objects of this class
          represent a piece of time-tagged data that can be logged to a file.




          CMLog​Item defines only a read-only timestamp property that records the time a motion-event measurement was taken. Not the exact time since device was booted.



          By ProcessInfo.processInfo.systemUptime you going to get time from the last time it was restarted.



          I believe data that you would like to obtain is quite specific and is under Private API of the iOS.






          share|improve this answer
























          • Thanks for response.

            – Andrey M.
            Apr 10 '17 at 7:24











          • here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

            – Andrey M.
            Apr 24 '17 at 8:59











          • @AndreyM. thx for sharing of the info

            – Oleg Gordiichuk
            Apr 24 '17 at 8:59


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          After investigation of the data you provide. It is possible to conclude that CMLog​Item:




          The CMLog​Item class is a base class for Core Motion classes that
          handle specific types of motion events. Objects of this class
          represent a piece of time-tagged data that can be logged to a file.




          CMLog​Item defines only a read-only timestamp property that records the time a motion-event measurement was taken. Not the exact time since device was booted.



          By ProcessInfo.processInfo.systemUptime you going to get time from the last time it was restarted.



          I believe data that you would like to obtain is quite specific and is under Private API of the iOS.






          share|improve this answer
























          • Thanks for response.

            – Andrey M.
            Apr 10 '17 at 7:24











          • here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

            – Andrey M.
            Apr 24 '17 at 8:59











          • @AndreyM. thx for sharing of the info

            – Oleg Gordiichuk
            Apr 24 '17 at 8:59
















          1














          After investigation of the data you provide. It is possible to conclude that CMLog​Item:




          The CMLog​Item class is a base class for Core Motion classes that
          handle specific types of motion events. Objects of this class
          represent a piece of time-tagged data that can be logged to a file.




          CMLog​Item defines only a read-only timestamp property that records the time a motion-event measurement was taken. Not the exact time since device was booted.



          By ProcessInfo.processInfo.systemUptime you going to get time from the last time it was restarted.



          I believe data that you would like to obtain is quite specific and is under Private API of the iOS.






          share|improve this answer
























          • Thanks for response.

            – Andrey M.
            Apr 10 '17 at 7:24











          • here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

            – Andrey M.
            Apr 24 '17 at 8:59











          • @AndreyM. thx for sharing of the info

            – Oleg Gordiichuk
            Apr 24 '17 at 8:59














          1












          1








          1







          After investigation of the data you provide. It is possible to conclude that CMLog​Item:




          The CMLog​Item class is a base class for Core Motion classes that
          handle specific types of motion events. Objects of this class
          represent a piece of time-tagged data that can be logged to a file.




          CMLog​Item defines only a read-only timestamp property that records the time a motion-event measurement was taken. Not the exact time since device was booted.



          By ProcessInfo.processInfo.systemUptime you going to get time from the last time it was restarted.



          I believe data that you would like to obtain is quite specific and is under Private API of the iOS.






          share|improve this answer













          After investigation of the data you provide. It is possible to conclude that CMLog​Item:




          The CMLog​Item class is a base class for Core Motion classes that
          handle specific types of motion events. Objects of this class
          represent a piece of time-tagged data that can be logged to a file.




          CMLog​Item defines only a read-only timestamp property that records the time a motion-event measurement was taken. Not the exact time since device was booted.



          By ProcessInfo.processInfo.systemUptime you going to get time from the last time it was restarted.



          I believe data that you would like to obtain is quite specific and is under Private API of the iOS.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 7 '17 at 11:35









          Oleg GordiichukOleg Gordiichuk

          9,79853873




          9,79853873













          • Thanks for response.

            – Andrey M.
            Apr 10 '17 at 7:24











          • here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

            – Andrey M.
            Apr 24 '17 at 8:59











          • @AndreyM. thx for sharing of the info

            – Oleg Gordiichuk
            Apr 24 '17 at 8:59



















          • Thanks for response.

            – Andrey M.
            Apr 10 '17 at 7:24











          • here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

            – Andrey M.
            Apr 24 '17 at 8:59











          • @AndreyM. thx for sharing of the info

            – Oleg Gordiichuk
            Apr 24 '17 at 8:59

















          Thanks for response.

          – Andrey M.
          Apr 10 '17 at 7:24





          Thanks for response.

          – Andrey M.
          Apr 10 '17 at 7:24













          here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

          – Andrey M.
          Apr 24 '17 at 8:59





          here developer.apple.com/reference/coremotion/cmlogitem/… you can see that timestamp is amount of time since the device booted.

          – Andrey M.
          Apr 24 '17 at 8:59













          @AndreyM. thx for sharing of the info

          – Oleg Gordiichuk
          Apr 24 '17 at 8:59





          @AndreyM. thx for sharing of the info

          – Oleg Gordiichuk
          Apr 24 '17 at 8:59





          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory