URL
https://opencores.org/ocsvn/plasma/plasma/trunk
[/] [plasma/] [trunk/] [kernel/] [netutil.c] - Diff between revs 362 and 366
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 362 |
Rev 366 |
Line 918... |
Line 918... |
|
|
static void ConsoleUptime(IPSocket *socket, char *argv[])
|
static void ConsoleUptime(IPSocket *socket, char *argv[])
|
{
|
{
|
int days, hours, minutes, seconds;
|
int days, hours, minutes, seconds;
|
(void)argv;
|
(void)argv;
|
seconds = OS_ThreadTime() / 100;
|
//ticks per sec = 25E6/2^18 = 95.36743 -> 10.48576 ms/tick
|
|
seconds = OS_ThreadTime() / 95;
|
minutes = seconds / 60 % 60;
|
minutes = seconds / 60 % 60;
|
hours = seconds / 3600 % 24;
|
hours = seconds / 3600 % 24;
|
days = seconds / 3600 / 24;
|
days = seconds / 3600 / 24;
|
seconds %= 60;
|
seconds %= 60;
|
IPPrintf(socket, "%d days %2d:%2d:%2d\n", days, hours, minutes, seconds);
|
IPPrintf(socket, "%d days %2d:%2d:%2d\n", days, hours, minutes, seconds);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.