Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Русский

Change language to:
English - Français - 日本語 - Português -

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Справка Scilab >> Time and Date > realtimeinit

realtimeinit

set time unit

realtime

set dates origin or waits until date

Syntax

realtimeinit(time_unit)
realtime(t)

Arguments

time_unit

a real number. The number of seconds associated to the realtime argument

t

a real number. A date

Description

These two functions can be used to handle real time into Scilab.

realtimeinit(time_unit) defines the time unit associated to the realtime argument t

first call to realtime(t0) sets current date to (t0). subsequent calls to realtime(t) wait till date t is reached.

Examples

realtimeinit(1/2);//sets time unit to half a second
realtime(0);//sets current date to 0
for k=1:10
  realtime(k);
  mprintf('current time is '+string(k/2)+'sec .\r\n');
end

//next instruction outputs a dot each 2 seconds
realtimeinit(2);
realtime(0);
for k=1:10
  realtime(k);
  mprintf('.\r\n');
end

realtimeinit(1);
realtime(0);
dt=getdate('s');
realtime(10);
getdate('s')-dt
realtimeinit(1);
realtime(0);
t1 = now()
datevec(t1)
realtime(10);
t1 = now()
datevec(t1)

See also

  • getdate — get date and time information
Report an issue
<< now Time and Date sleep >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:13:26 CET 2017