--- title: "Bits and Bytes" type: "article" slug: "bits-and-bytes-34" url: "http://localhost/article/bits-and-bytes-34/" markdown_url: "http://localhost/article/bits-and-bytes-34.md" published_at: "2026-01-17T10:44:18+00:00" modified_at: "2026-01-17T10:44:19+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "203 On a TS2068 the following subroutine will return the elapsed time in seconds that a program has been running if you input a GOTO 9999 after line 1 has been run. 1 POKE 23672,0: POKE 23673,0 9999 PRINT INT (PEEK 23672+ 256 * PEEK 23673 + .5) * 100/60.1145 + 5)/100 204 Here is…" category: - name: "QZX" slug: "qzx" taxonomy: "category" url: "http://localhost/category/periodicals/qzx/" post_tag: - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Alex Burr (K5XY)" slug: "alex-burr" taxonomy: "indiv" url: "http://localhost/indiv/alex-burr/" publication: "QZX" publication_r: id: 21219 title: "QZX" type: "periodical" url: "http://localhost/periodical/qzx/" authors_r: - name: "Alex Burr (K5XY)" slug: "alex-burr" taxonomy: "indiv" url: "http://localhost/indiv/alex-burr/" volume: "11" issue: "8" issues_articles: - id: 50206 title: "QZX v11 n8" type: "issue" url: "http://localhost/issue/qzx-v11-n8/" pages: "3" pubdate: "July 1993" archive_link: false --- # Bits and Bytes 203 On a TS2068 the following subroutine will return the elapsed time in seconds that a program has been running if you input a GOTO 9999 after line 1 has been run. ``` 1 POKE 23672,0: POKE 23673,0 9999 PRINT INT (PEEK 23672+ 256 * PEEK 23673 + .5) * 100/60.1145 + 5)/100 ``` 204 Here is a short TS2068 routine which will copy all 24 screen lines to the TS2040 printer. . ``` 8000 RESTORE: FOR N = 24500 TO 24505: READ X: POKE N,X: NEXT N: DATA 243,6, 192, 195,5, 10. ``` To use this machine code utility run line 8000 to POKE the code and call the utility with ``` RAND USR 24500. ``` This TS 2068 program will invert the screen display. ``` 8100 FOR N = 116384 to 22527: LET X = PEEK N: POKE N,255-X: NEXT N ``` 205 The following POKE resets the PRINT position on the screen (where N = 4 resets to the top of the screen, and N = 5 to 24 resets to any line on the screen. ``` POKE 23689,N ```