• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

oga's tools


Commit MetaInfo

修訂e03f7e928562b7fb4d44772a4a5c840e82483621 (tree)
時間2014-01-05 14:13:21
作者oga <hyperoga@gmai...>
Commiteroga

Log Message

add usleep.c

Change Summary

差異

--- a/Makefile.linux
+++ b/Makefile.linux
@@ -26,7 +26,7 @@ TARGETS=$(VP)/age $(VP)/cal2 $(VP)/cgrep $(VP)/cmem $(VP)/cpkt $(VP)/cpuid \
2626 $(VP)/peke2 $(VP)/peke $(VP)/perfan $(VP)/strings2 $(VP)/t64an \
2727 $(VP)/tolower $(VP)/txt2vnt $(VP)/upload $(VP)/wavana $(VP)/wavcut2 \
2828 $(VP)/wavcut $(VP)/welcome $(VP)/whichx $(VP)/wwstat $(VP)/xalloc \
29- $(VP)/zusa $(VP)/rand2
29+ $(VP)/zusa $(VP)/rand2 $(VP)/usleep
3030
3131 TARGET_X=$(VP)/qix $(VP)/xmem $(VP)/xpkt $(VP)/xpstat
3232
@@ -289,6 +289,9 @@ $(VP)/u2dos : $(TOOL)/u2dos.c
289289 $(VP)/upload : $(TOOL)/upload.c
290290 ${CC} $? -o $@ -O
291291
292+$(VP)/usleep : $(TOOL)/usleep.c
293+ ${CC} $? -o $@ -O
294+
292295 $(VP)/wavana : $(TOOL)/wavana.c
293296 ${CC} $? -o $@ -O
294297
--- /dev/null
+++ b/usleep.c
@@ -0,0 +1,20 @@
1+#include <stdio.h>
2+#include <stdlib.h>
3+
4+int main(int a, char *b[])
5+{
6+ int i;
7+ int ms = 0;
8+
9+ for (i = 1; i < a; i++) {
10+ if (!strcmp(b[i], "-h")) {
11+ printf("usage: usleep <ms>\n");
12+ return 1;
13+ }
14+ ms = atoi(b[i]);
15+ }
16+
17+ usleep(ms * 1000);
18+
19+ return 0;
20+}