LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 11-28-2019, 10:55 AM   #1
elig
LQ Newbie
 
Registered: Nov 2019
Posts: 3

Rep: Reputation: Disabled
Get system time


Hello
I have a NFX board with Linux running on. I have to know the the system time passed from the Linux or board comes up. My application is written in C++. C is also applicable.

Thanks, Eli
 
Old 11-28-2019, 03:24 PM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,959

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
Would the time(2) systsm call fit the bill? http://man7.org/linux/man-pages/man2/time.2.html.
 
Old 12-01-2019, 01:29 AM   #3
elig
LQ Newbie
 
Registered: Nov 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
time(2) as described in Linux manual page you attached
Quote:
time() returns the time as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
I'm looking for a boot time that starts when the board or Linux comes up.

Last edited by elig; 12-01-2019 at 02:44 AM.
 
Old 12-01-2019, 04:32 AM   #4
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,959

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
clock_gettime(2) with a clock ID of CLOCK_MONOTONIC.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
user time, system time, real time .. reg chaitanyajun12 Linux - Newbie 7 03-14-2016 06:43 PM
how to understand user time, sys time, wait time, idle time of CPU guixingyi Linux - Server 1 08-24-2010 11:10 AM
System time vs Hardware time and Daylight Savings Time Toadman Linux - General 6 03-17-2007 09:12 AM
System time vs Hardware time and Daylight Savings Time Toadman Linux - Networking 6 03-16-2007 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 07:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration