Browse Subversion Repository
Contents of /trunk/doc/en/html/macro/command/uptime.html
Parent Directory
| Revision Log
Revision 8939 -
( show annotations)
( download)
( as text)
Thu Oct 1 16:06:58 2020 UTC
(3 years, 7 months ago)
by nmaya
File MIME type: text/html
File size: 1375 byte(s)
マクロコマンドが Tera Term バージョンいくつから存在するか、それぞれのマクロコマンドのヘルプページに記載
ticket #40808
MFT to: 4-stable
| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
| 3 |
<html> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 6 |
<title>uptime</title> |
| 7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
| 8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
| 9 |
</head> |
| 10 |
|
| 11 |
<body> |
| 12 |
|
| 13 |
|
| 14 |
<h1>uptime</h1> |
| 15 |
|
| 16 |
<p> |
| 17 |
Gets System Up Time. <em>(version 4.81 or later)</em> |
| 18 |
</p> |
| 19 |
|
| 20 |
<pre class="macro-syntax"> |
| 21 |
uptime <intvar> |
| 22 |
</pre> |
| 23 |
|
| 24 |
<h2>Remarks</h2> |
| 25 |
|
| 26 |
<p> |
| 27 |
Retrieves the number of milliseconds that have elapsed since the Windows OS was started, |
| 28 |
and then stores the value into the <intvar> variable. |
| 29 |
</p> |
| 30 |
|
| 31 |
<p> |
| 32 |
The time wraps around to zero if the system is run continuously for 49.7 days. |
| 33 |
</p> |
| 34 |
|
| 35 |
|
| 36 |
<h2>Example</h2> |
| 37 |
|
| 38 |
<pre class="macro-example"> |
| 39 |
; How to get the uptime in Windows |
| 40 |
uptime var |
| 41 |
day = var / 86400000 |
| 42 |
var = var % 86400000 |
| 43 |
hour = var / 3600000 |
| 44 |
var = var % 3600000 |
| 45 |
min = var / 60000 |
| 46 |
var = var % 60000 |
| 47 |
sec = var / 1000 |
| 48 |
|
| 49 |
sprintf2 str "System Up Time: %d Days, %d Hours, %d Minutes, %d Seconds" day hour min sec |
| 50 |
messagebox str "uptime" |
| 51 |
</pre> |
| 52 |
|
| 53 |
<pre class="macro-example"> |
| 54 |
uptime varstart |
| 55 |
|
| 56 |
; do something... |
| 57 |
|
| 58 |
uptime varend |
| 59 |
diff = varend - varstart |
| 60 |
sprintf2 str "MACRO running time: %d msec" diff |
| 61 |
messagebox str "running time" |
| 62 |
</pre> |
| 63 |
|
| 64 |
</body> |
| 65 |
</html> |
|