home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / TNH_PC.ZIP / GASTON.NL < prev    next >
Encoding:
Text File  |  1987-01-14  |  4.5 KB  |  150 lines

  1. Tracking Time Spent Programming
  2.  
  3.              Chuck Gaston
  4.   Poughkeepsie IBM Microcomputer Club
  5.  
  6. If you would like to know how much
  7. time you REALLY spend using your
  8. computer, working on a particular
  9. project or playing Pac-Man, here is a
  10. way to do it.
  11.  
  12. While using an IBM PC to write a
  13. book, I wanted to know both how much
  14. time I was devoting to the effort and
  15. how long it took me per page of
  16. output. A system disk used only for
  17. this project contains all the
  18. components of DOS that I need;
  19. Personal Editor, and the various
  20. utility files, including the programs
  21. shown here. The book sections are
  22. stored on a separate disk in drive B.
  23.  
  24. The AUTOEXEC file on the system disk
  25. sets up everything exactly as I want
  26. it for a writing session, and
  27. automatically records the starting
  28. time on the system disk. If I exit
  29. Personal Editor when finished
  30. (instead of just switching off the
  31. power), ending time also is recorded,
  32. and there is the option of adding a
  33. comment about the session.
  34.  
  35. There are several interesting
  36. features about this AUTOEXEC file,
  37. but at this time I will provide only
  38. brief comments about most of them,
  39. which may give you some ideas. The
  40. focus of this article is on the BASIC
  41. programs for recording session time.
  42.  
  43. AUTOEXEC.BAT          Comments
  44. ------------          --------
  45. simdisk 10         Creates 38K RAM-
  46.                    disk for fast
  47.                    operations
  48. date               Until I can afford
  49.                    a battery-operated
  50. time               clock-calendar,
  51.                    these are
  52.                    necessary
  53. basica start     * Automatically
  54.                    records starting
  55.                    time
  56. copy pe.pro c:     PE profile must be
  57.                    on default drive
  58. copy *.mac c:      Transfer "macros"
  59.                    to default drive
  60. sp 5               SP is an excellent
  61.                    print spooler
  62. c:                 Make the virtual
  63.                    disk the default
  64.                    drive
  65. a:pe b:contents.bb Invoke PE; get
  66.                    Contents page of
  67.                    book
  68. a:                 Upon exit, return
  69.                    to A: drive
  70.                    default
  71. basica end       * Record ending time
  72.                    and comment
  73.  
  74. *  THESE STEPS IN THE AUTOEXEC FILE
  75. automatically log my times.
  76.  
  77. The START and END programs I use
  78. actually are written as "oneliners",
  79. but below they are spread out and
  80. commented for ease of understanding.
  81. It can be useful to preserve
  82. fully-commented versions of programs
  83. for review and revision, while saving
  84. space with compressed versions
  85. wherever you actually use them.
  86.  
  87. 10 '========== START ==========
  88. 20 OPEN "a:times" FOR APPEND AS #1
  89.     'Accumulate all times
  90. 30 PRINT #1, "Start: ";DATE$;"  ";
  91.    TIME$     'This does the recording
  92. 40 CLOSE #1 : SYSTEM
  93.    'Wrap-up; return to DOS
  94.  
  95. 10 '=========== END ===========
  96. 20 OPEN "a:times" FOR APPEND AS #1
  97.    'Keep adding to "times"
  98. 30 PRINT #1, "End: ";DATE$;"  ";
  99.    TIME$;  'Don't end this line yet
  100. 32 INPUT "Comment about session: ",
  101.    X$    'Get optional comment
  102. 34 PRINT #1, "  ";X$ : PRINT #1,
  103.    'Add comment & skip line
  104. 40 CLOSE #1 : SYSTEM
  105.    'Wrap-up; return to DOS
  106.  
  107. Here is an example of the TIMES file:
  108.  
  109. Start: 01-07-1984  08:59:39
  110.   End: 01-07-1984  08:59:45
  111.     Begin demonstration series.
  112.  
  113. Start: 01-07-1984  09:00:14
  114.   End: 01-07-1984  09:00:21
  115.     Second test.
  116.  
  117. Start: 01-07-1984  09:00:34
  118. Start: 01-07-1984  09:00:40
  119.     Final test!
  120.  
  121. If you eliminate lines 32 and 34 and
  122. the semicolon at the end of line 30,
  123. the operation of END becomes as
  124. relatively unobtrusive as that of
  125. START. Thus, if you are satisfied
  126. with uncommented time-recording, you
  127. can ignore the slight delays and
  128. extra disk noises.
  129.  
  130. Note that if you are working with a
  131. BASIC application, START and END can
  132. be renumbered to fit within the main
  133. program, or you can CHAIN from one
  134. BASIC program to the next. The
  135. AUTOEXEC file can call START, which
  136. can be modified to CHAIN to the main
  137. program instead of returning to
  138. SYSTEM. Then that main program can be
  139. modified to CHAIN to END.
  140.  
  141. There you have it. Do you really want
  142. to know how much time you will spend
  143. developing that program to select the
  144. winners at Monticello or working on
  145. the newsletter?  How about adding
  146. these programs to the game disk to
  147. find out how much time the kids spend
  148. on Pac-Man when they should be doing
  149. their homework?
  150.